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