##// END OF EJS Templates
Merge pull request #7951 from minrk/pdf-via-latex...
Merge pull request #7951 from minrk/pdf-via-latex make 'download as PDF' say 'via LaTeX'

File last commit:

r19230:d445184d
r20627:a1e93fb0 merge
Show More
kernel_mixins.py
50 lines | 1.6 KiB | text/x-python | PythonLexer
MinRK
pyin -> execute_input
r16567 """Defines a KernelManager that provides signals and slots."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408
from IPython.external.qt import QtCore
epatters
BUG: QtKernelManagerMixin does not define PyQt4-safe signals.
r8456 from IPython.utils.traitlets import HasTraits, Type
Thomas Kluyver
Use explicit relative imports...
r13347 from .util import MetaQObjectHasTraits, SuperQObject
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408
Thomas Kluyver
Fixes for metaclass syntax
r13359 class QtKernelRestarterMixin(MetaQObjectHasTraits('NewBase', (HasTraits, SuperQObject), {})):
MinRK
add QtKernelManager with restarter
r10308
_timer = None
Thomas Kluyver
Fixes for metaclass syntax
r13359 class QtKernelManagerMixin(MetaQObjectHasTraits('NewBase', (HasTraits, SuperQObject), {})):
MinRK
add QtKernelManager with restarter
r10308 """ A KernelClient that provides signals and slots.
"""
kernel_restarted = QtCore.Signal()
Thomas Kluyver
Fixes for metaclass syntax
r13359 class QtKernelClientMixin(MetaQObjectHasTraits('NewBase', (HasTraits, SuperQObject), {})):
MinRK
update Qt to use KernelClient
r10288 """ A KernelClient that provides signals and slots.
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 """
MinRK
update Qt to use KernelClient
r10288 # Emitted when the kernel client has started listening.
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 started_channels = QtCore.Signal()
MinRK
update Qt to use KernelClient
r10288 # Emitted when the kernel client has stopped listening.
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 stopped_channels = QtCore.Signal()
#---------------------------------------------------------------------------
MinRK
update Qt to use KernelClient
r10288 # 'KernelClient' interface
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 #---------------------------------------------------------------------------
#------ Channel management -------------------------------------------------
def start_channels(self, *args, **kw):
""" Reimplemented to emit signal.
"""
MinRK
update Qt to use KernelClient
r10288 super(QtKernelClientMixin, self).start_channels(*args, **kw)
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 self.started_channels.emit()
def stop_channels(self):
""" Reimplemented to emit signal.
"""
MinRK
update Qt to use KernelClient
r10288 super(QtKernelClientMixin, self).stop_channels()
epatters
Refactor kernel managers in preparation for the EmbeddedKernel.
r8408 self.stopped_channels.emit()