##// END OF EJS Templates
BUG: QtKernelManagerMixin does not define PyQt4-safe signals.
epatters -
Show More
@@ -5,8 +5,8 b''
5 from IPython.external.qt import QtCore
5 from IPython.external.qt import QtCore
6
6
7 # IPython imports.
7 # IPython imports.
8 from IPython.utils.traitlets import Type
8 from IPython.utils.traitlets import HasTraits, Type
9 from util import SuperQObject
9 from util import MetaQObjectHasTraits, SuperQObject
10
10
11
11
12 class ChannelQObject(SuperQObject):
12 class ChannelQObject(SuperQObject):
@@ -189,10 +189,12 b' class QtHBChannelMixin(ChannelQObject):'
189 self.kernel_died.emit(since_last_heartbeat)
189 self.kernel_died.emit(since_last_heartbeat)
190
190
191
191
192 class QtKernelManagerMixin(object):
192 class QtKernelManagerMixin(HasTraits, SuperQObject):
193 """ A KernelManager that provides signals and slots.
193 """ A KernelManager that provides signals and slots.
194 """
194 """
195
195
196 __metaclass__ = MetaQObjectHasTraits
197
196 # Emitted when the kernel manager has started listening.
198 # Emitted when the kernel manager has started listening.
197 started_kernel = QtCore.Signal()
199 started_kernel = QtCore.Signal()
198
200
@@ -8,7 +8,6 b' from IPython.embedded.kernelmanager import \\'
8 from IPython.utils.traitlets import Type
8 from IPython.utils.traitlets import Type
9 from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
9 from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
10 QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
10 QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
11 from util import MetaQObjectHasTraits, SuperQObject
12
11
13
12
14 class QtShellEmbeddedChannel(QtShellChannelMixin, ShellEmbeddedChannel):
13 class QtShellEmbeddedChannel(QtShellChannelMixin, ShellEmbeddedChannel):
@@ -24,13 +23,10 b' class QtHBEmbeddedChannel(QtHBChannelMixin, HBEmbeddedChannel):'
24 pass
23 pass
25
24
26
25
27 class QtEmbeddedKernelManager(QtKernelManagerMixin,
26 class QtEmbeddedKernelManager(QtKernelManagerMixin, EmbeddedKernelManager):
28 EmbeddedKernelManager, SuperQObject):
29 """ An embedded KernelManager that provides signals and slots.
27 """ An embedded KernelManager that provides signals and slots.
30 """
28 """
31
29
32 __metaclass__ = MetaQObjectHasTraits
33
34 sub_channel_class = Type(QtSubEmbeddedChannel)
30 sub_channel_class = Type(QtSubEmbeddedChannel)
35 shell_channel_class = Type(QtShellEmbeddedChannel)
31 shell_channel_class = Type(QtShellEmbeddedChannel)
36 stdin_channel_class = Type(QtStdInEmbeddedChannel)
32 stdin_channel_class = Type(QtStdInEmbeddedChannel)
@@ -7,7 +7,6 b' from IPython.zmq.kernelmanager import ShellSocketChannel, SubSocketChannel, \\'
7 StdInSocketChannel, HBSocketChannel, KernelManager
7 StdInSocketChannel, HBSocketChannel, KernelManager
8 from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
8 from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
9 QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
9 QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
10 from util import MetaQObjectHasTraits, SuperQObject
11
10
12
11
13 class QtShellSocketChannel(QtShellChannelMixin, ShellSocketChannel):
12 class QtShellSocketChannel(QtShellChannelMixin, ShellSocketChannel):
@@ -23,12 +22,10 b' class QtHBSocketChannel(QtHBChannelMixin, HBSocketChannel):'
23 pass
22 pass
24
23
25
24
26 class QtKernelManager(QtKernelManagerMixin, KernelManager, SuperQObject):
25 class QtKernelManager(QtKernelManagerMixin, KernelManager):
27 """ A KernelManager that provides signals and slots.
26 """ A KernelManager that provides signals and slots.
28 """
27 """
29
28
30 __metaclass__ = MetaQObjectHasTraits
31
32 sub_channel_class = Type(QtSubSocketChannel)
29 sub_channel_class = Type(QtSubSocketChannel)
33 shell_channel_class = Type(QtShellSocketChannel)
30 shell_channel_class = Type(QtShellSocketChannel)
34 stdin_channel_class = Type(QtStdInSocketChannel)
31 stdin_channel_class = Type(QtStdInSocketChannel)
@@ -56,7 +56,7 b' class SuperQObject(QtCore.QObject):'
56 they don't inherit QObject.)
56 they don't inherit QObject.)
57
57
58 This class is primarily useful for attaching signals to existing non-Qt
58 This class is primarily useful for attaching signals to existing non-Qt
59 classes. See QtKernelManager for an example.
59 classes. See QtKernelManagerMixin for an example.
60 """
60 """
61
61
62 def __new__(cls, *args, **kw):
62 def __new__(cls, *args, **kw):
General Comments 0
You need to be logged in to leave comments. Login now