Permalink
Browse files

BUG: QtKernelManagerMixin does not define PyQt4-safe signals.

  • Loading branch information...
1 parent 40e9f49 commit 346e7abcb67b8d69663fa5c6f363ac3d753ed99f @epatters epatters committed Sep 17, 2012
@@ -5,8 +5,8 @@
from IPython.external.qt import QtCore
# IPython imports.
-from IPython.utils.traitlets import Type
-from util import SuperQObject
+from IPython.utils.traitlets import HasTraits, Type
+from util import MetaQObjectHasTraits, SuperQObject
class ChannelQObject(SuperQObject):
@@ -189,10 +189,12 @@ def call_handlers(self, since_last_heartbeat):
self.kernel_died.emit(since_last_heartbeat)
-class QtKernelManagerMixin(object):
+class QtKernelManagerMixin(HasTraits, SuperQObject):
""" A KernelManager that provides signals and slots.
"""
+ __metaclass__ = MetaQObjectHasTraits
+
# Emitted when the kernel manager has started listening.
started_kernel = QtCore.Signal()
@@ -8,7 +8,6 @@
from IPython.utils.traitlets import Type
from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
-from util import MetaQObjectHasTraits, SuperQObject
class QtShellEmbeddedChannel(QtShellChannelMixin, ShellEmbeddedChannel):
@@ -24,13 +23,10 @@ class QtHBEmbeddedChannel(QtHBChannelMixin, HBEmbeddedChannel):
pass
-class QtEmbeddedKernelManager(QtKernelManagerMixin,
- EmbeddedKernelManager, SuperQObject):
+class QtEmbeddedKernelManager(QtKernelManagerMixin, EmbeddedKernelManager):
""" An embedded KernelManager that provides signals and slots.
"""
- __metaclass__ = MetaQObjectHasTraits
-
sub_channel_class = Type(QtSubEmbeddedChannel)
shell_channel_class = Type(QtShellEmbeddedChannel)
stdin_channel_class = Type(QtStdInEmbeddedChannel)
@@ -7,7 +7,6 @@
StdInSocketChannel, HBSocketChannel, KernelManager
from base_kernelmanager import QtShellChannelMixin, QtSubChannelMixin, \
QtStdInChannelMixin, QtHBChannelMixin, QtKernelManagerMixin
-from util import MetaQObjectHasTraits, SuperQObject
class QtShellSocketChannel(QtShellChannelMixin, ShellSocketChannel):
@@ -23,12 +22,10 @@ class QtHBSocketChannel(QtHBChannelMixin, HBSocketChannel):
pass
-class QtKernelManager(QtKernelManagerMixin, KernelManager, SuperQObject):
+class QtKernelManager(QtKernelManagerMixin, KernelManager):
""" A KernelManager that provides signals and slots.
"""
- __metaclass__ = MetaQObjectHasTraits
-
sub_channel_class = Type(QtSubSocketChannel)
shell_channel_class = Type(QtShellSocketChannel)
stdin_channel_class = Type(QtStdInSocketChannel)
@@ -56,7 +56,7 @@ class SuperQObject(QtCore.QObject):
they don't inherit QObject.)
This class is primarily useful for attaching signals to existing non-Qt
- classes. See QtKernelManager for an example.
+ classes. See QtKernelManagerMixin for an example.
"""
def __new__(cls, *args, **kw):

0 comments on commit 346e7ab

Please sign in to comment.