Show More
@@ -1,24 +1,9 b'' | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | """Pylab (matplotlib) support utilities. | |
|
3 | ||
|
4 | Authors | |
|
5 | ------- | |
|
6 | ||
|
7 | * Fernando Perez. | |
|
8 | * Brian Granger | |
|
9 | """ | |
|
2 | """Pylab (matplotlib) support utilities.""" | |
|
10 | 3 | from __future__ import print_function |
|
11 | 4 | |
|
12 | #----------------------------------------------------------------------------- | |
|
13 | # Copyright (C) 2009 The IPython Development Team | |
|
14 | # | |
|
15 | # Distributed under the terms of the BSD License. The full license is in | |
|
16 | # the file COPYING, distributed as part of this software. | |
|
17 | #----------------------------------------------------------------------------- | |
|
18 | ||
|
19 | #----------------------------------------------------------------------------- | |
|
20 | # Imports | |
|
21 | #----------------------------------------------------------------------------- | |
|
5 | # Copyright (c) IPython Development Team. | |
|
6 | # Distributed under the terms of the Modified BSD License. | |
|
22 | 7 | |
|
23 | 8 | from io import BytesIO |
|
24 | 9 | |
@@ -34,7 +19,9 b" backends = {'tk': 'TkAgg'," | |||
|
34 | 19 | 'wx': 'WXAgg', |
|
35 | 20 | 'qt': 'Qt4Agg', # qt3 not supported |
|
36 | 21 | 'qt4': 'Qt4Agg', |
|
22 | 'qt5': 'Qt5Agg', | |
|
37 | 23 | 'osx': 'MacOSX', |
|
24 | 'nbagg': 'nbAgg', | |
|
38 | 25 | 'inline' : 'module://IPython.kernel.zmq.pylab.backend_inline'} |
|
39 | 26 | |
|
40 | 27 | # We also need a reverse backends2guis mapping that will properly choose which |
@@ -1,33 +1,18 b'' | |||
|
1 | 1 | # encoding: utf-8 |
|
2 | """Event loop integration for the ZeroMQ-based kernels. | |
|
3 | """ | |
|
4 | ||
|
5 | #----------------------------------------------------------------------------- | |
|
6 | # Copyright (C) 2011 The IPython Development Team | |
|
7 | ||
|
8 | # Distributed under the terms of the BSD License. The full license is in | |
|
9 | # the file COPYING, distributed as part of this software. | |
|
10 | #----------------------------------------------------------------------------- | |
|
2 | """Event loop integration for the ZeroMQ-based kernels.""" | |
|
11 | 3 | |
|
4 | # Copyright (c) IPython Development Team. | |
|
5 | # Distributed under the terms of the Modified BSD License. | |
|
12 | 6 | |
|
13 | #----------------------------------------------------------------------------- | |
|
14 | # Imports | |
|
15 | #----------------------------------------------------------------------------- | |
|
16 | ||
|
7 | import os | |
|
17 | 8 | import sys |
|
18 | 9 | |
|
19 | # System library imports | |
|
20 | 10 | import zmq |
|
21 | 11 | |
|
22 | # Local imports | |
|
23 | 12 | from IPython.config.application import Application |
|
24 | 13 | from IPython.utils import io |
|
25 | 14 | |
|
26 | 15 | |
|
27 | #------------------------------------------------------------------------------ | |
|
28 | # Eventloops for integrating the Kernel into different GUIs | |
|
29 | #------------------------------------------------------------------------------ | |
|
30 | ||
|
31 | 16 | def _on_os_x_10_9(): |
|
32 | 17 | import platform |
|
33 | 18 | from distutils.version import LooseVersion as V |
@@ -54,6 +39,7 b' def _notify_stream_qt(kernel, stream):' | |||
|
54 | 39 | # mapping of keys to loop functions |
|
55 | 40 | loop_map = { |
|
56 | 41 | 'inline': None, |
|
42 | 'nbagg': None, | |
|
57 | 43 | None : None, |
|
58 | 44 | } |
|
59 | 45 | |
@@ -92,6 +78,12 b' def loop_qt4(kernel):' | |||
|
92 | 78 | |
|
93 | 79 | start_event_loop_qt4(kernel.app) |
|
94 | 80 | |
|
81 | @register_integration('qt5') | |
|
82 | def loop_qt5(kernel): | |
|
83 | """Start a kernel with PyQt5 event loop integration.""" | |
|
84 | os.environ['QT_API'] = 'pyqt5' | |
|
85 | return loop_qt4(kernel) | |
|
86 | ||
|
95 | 87 | |
|
96 | 88 | @register_integration('wx') |
|
97 | 89 | def loop_wx(kernel): |
General Comments 0
You need to be logged in to leave comments.
Login now