vdat.gui.queue – The Queue window¶
Create a window representing a queue via a list of items.
The original implementation has been generated from reading ui file ‘listWindow.ui’
Created: Mon Jun 15 16:25:52 2015 by: PyQt4 UI code generator 4.10.4
-
class
vdat.gui.queue.QueuedCommand(command, label, tool_tip=None, parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QListWidgetItemClass describing the objects stored in the
ModifyableListWidget.Each object represent a command
Parameters: - command :
QCommandInterpreter instance of the command interpreter to add to the queue
- label : string
a label to appear for this command on the queue
- tool_tip : string, optional
tool tip to show
- parent :
PyQt5.QtWidgets.QWidgetinstance the parent widget
- command :
-
class
vdat.gui.queue.ModifyableListWidget[source]¶ Bases:
PyQt5.QtWidgets.QListWidgetList widget with the possibility to remove items
-
class
vdat.gui.queue.Queue(parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QMainWindowA queue that stores user commands and displays them in a GUI window.
Custom signals¶ Name Signature Description closeSignalemitted when the queue window is closed job_addedemitted when a job is added to the queue run_signalemitted when a new command can be run queue_empty_signalemitted when the queue is empty command_donebool these five signals are a Qt re-implementation of the signals described in the signalscommand_stringint, str global_loggerint, str n_primariesint progressint, int, int, int Custom slot¶ Name Signature Description toggle()bool hide (False) or show (True) the panel run()grab a command from the queue and run it toggle_and_rerun()prepare to run a new command Connections between custom signals and/or slots¶ Signal Slot/Signal job_addedrun()run_signalrun()QCommandInterpreter.command_donecommand_doneQCommandInterpreter.command_stringcommand_stringQCommandInterpreter.global_loggerglobal_loggerQCommandInterpreter.n_primariesn_primariesQCommandInterpreter.progressprogressPyQt5.QtCore.QThread.startedQCommandInterpreter.run()QCommandInterpreter.finishedtoggle_and_rerun()Parameters: - parent :
PyQt5.QtWidgets.QWidgetinstance the parent widget
Attributes: - is_command_running : bool
mark whether a command is running or not in a thread
-
closeSignal¶
-
job_added¶
-
run_signal¶
-
queue_empty_signal¶
-
command_done¶
-
command_string¶
-
global_logger¶
-
n_primaries¶
-
progress¶
-
_reconnect_names= ['command_done', 'command_string', 'global_logger', 'n_primaries', 'progress']¶
-
closeEvent(event)[source]¶ When the user closes the window, ignore the request, hide the window and emit the
closeSignalsignal.Parameters: - event :
PyQt5.QtGui.QKeyEvent object describing a key being pressed or released
- event :
-
toggle(tggl)[source]¶ Hide or show the panel. Alias of
setVisible().Parameters: - toggle : bool
whether the window is visible or not
-
add_command(command, label, tool_tip=None)[source]¶ Add a command to the queue. Emit the
job_addedsignal.Parameters: - command :
QCommandInterpreter instance of the command interpreter to add to the queue
- label : string
A label to appear for this command on the queue
- tool_tip : string, optional
tool tip to show
- command :
-
get_command()[source]¶ Get the top item from the queue.
Returns: - :class:`QCommandInterpreter` instance
command to run, or None if the list is empty
-
connect_worker_signals(worker)[source]¶ Connect the
workersignals to the corresponding ones in this classParameters: - worker :
QCommandInterpreter worker instance with the signals to connect with this object ones
- worker :
-
run()[source]¶ Grab a job from the queue and run it on a newly created
QThread.If a command is already running, and return. If the queue is empty notify the user and return.
The
QThreadandQCommandInterpreterinstances are saved in a local cache and removed the next timerun()is called.
-
toggle_and_rerun()[source]¶ Remove the old thread and command, mark that the command is not running and emit the
run_signalsignal
- parent :
-
class
vdat.gui.queue.QCommandInterpreter(*args, **kwargs)[source]¶ Bases:
vdat.command_interpreter.core.CommandInterpreter,PyQt5.QtCore.QObjectCreate a QObject from the
CommandInterpreter.Reimplement the
make_signals()to use only thecommand_loggersignals from the command_interpreter and useSignalfor the other signalsCustom signals¶ Name Signature Description command_donebool these five signals are a Qt re-implementation of the signals described in the signalscommand_stringint, str global_loggerint, str n_primariesint progressint, int, int, int finishedemitted when the run is finished Custom slot¶ Name Signature Description run()Run the command Parameters: - parent :
PyQt5.QtWidgets.QWidgetinstance the parent widget
- args, kwargs:
passed to the
CommandInterpreter
-
command_done¶
-
command_string¶
-
global_logger¶
-
n_primaries¶
-
progress¶
-
finished¶
-
make_signals()[source]¶ Use Signals instead of
vdat.command_interpreter.signals, except for the command_logger one
- parent :
-
class
vdat.gui.queue.QueuAction(*args, **kwargs)[source]¶ Bases:
PyQt5.QtWidgets.QActionAction for the queue window.
Create the menu entry and binds signals known by the queue window to show/hide it
Custom slot¶ Name Signature Description update_text()bool change the text to show in the action item Connections between custom signals and/or slots¶ Signal Slot/Signal toggledupdate_text()Queue.closeSignaltoggle()toggledQueue.toggle()Parameters: - *args, **kargs:
arguments passed to the parent class
-
vdat.gui.queue.set_queue(parent=None)[source]¶ Create a
Queueinstance and save it. You can access it withget_queue()Parameters: - parent :
PyQt5.QtWidgets.QWidgetinstance the parent widget
- parent :