qtspock
A RichJupyterWidget that loads a spock profile.
Note
The qtspock
module has been included in Sardana
on a provisional basis. Backwards incompatible changes
(up to and including its removal) may occur if
deemed necessary by the core developers.
Classes
QtSpockWidget
- class QtSpockWidget(parent=None, profile='spockdoor', use_model_from_profile=False, extensions=None, kernel='python3', **kw)[source]
Bases:
RichJupyterWidget
,TaurusBaseWidget
A RichJupyterWidget that starts a kernel with a spock profile.
Note
The
QtSpockWidget
class has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including its removal) may occur if deemed necessary by the core developers.It is important to call
shutdown_kernel
to gracefully clean up the started subprocesses.Useful methods of the base class include execute, interrupt_kernel, restart_kernel, and clear.
- Parameters:
profile (
str
) – The name of the spock profile to use. The default is ‘spockdoor’.kernel (
str
) – The name of the kernel to use. The default is ‘python3’.use_model_from_profile (
bool
) – If true, the door name is taken from the spock profile, otherwise it has to be set via setModel.kwargs – All remaining keywords are passed to the RichJupyterWidget base class
Examples:
from taurus.external.qt import Qt from sardana.taurus.qt.qtgui.extra_sardana.qtspock import QtSpockWidget app = Qt.QApplication(["qtspock"]) widget = QtSpockWidget(use_model_from_profile=True) widget.show() widget.start_kernel() app.aboutToQuit.connect(widget.shutdown_kernel) app.exec_()
- start_kernel()[source]
Start the kernel
A normal IPython kernel is started if no model is set via
setModel
oruse_model_from_profile
.
- setModel(door)[source]
Set a door as the model
An empty string or None will start a normal IPython kernel without spock functionality.
- get_value(var, timeout=None)[source]
Retrieve a value from the user namespace through a blocking call.
The value must be able to be pickled on the kernel side and unpickled on the frontend side.
The command will import the pickle module in the user namespace. This may overwrite a user defined variable with the same name.
QtSpock
- class QtSpock(parent=None, designMode=False)[source]
Bases:
TaurusMainWindow
A standalone QtSpock window
Note
The
QtSpock
class has been included in Sardana on a provisional basis. Backwards incompatible changes (up to and including its removal) may occur if deemed necessary by the core developers.