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.QListWidgetItem
Class 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.QWidget
instance the parent widget
- command :
-
class
vdat.gui.queue.
ModifyableListWidget
[source]¶ Bases:
PyQt5.QtWidgets.QListWidget
List widget with the possibility to remove items
-
class
vdat.gui.queue.
Queue
(parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
A queue that stores user commands and displays them in a GUI window.
¶ Name Signature Description closeSignal
emitted when the queue window is closed job_added
emitted when a job is added to the queue run_signal
emitted when a new command can be run queue_empty_signal
emitted when the queue is empty command_done
bool these five signals are a Qt re-implementation of the signals described in the signals
command_string
int, str global_logger
int, str n_primaries
int progress
int, int, int, int ¶ 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 Parameters: - parent :
PyQt5.QtWidgets.QWidget
instance 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
closeSignal
signal.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_added
signal.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
worker
signals 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
QThread
andQCommandInterpreter
instances 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_signal
signal
- parent :
-
class
vdat.gui.queue.
QCommandInterpreter
(*args, **kwargs)[source]¶ Bases:
vdat.command_interpreter.core.CommandInterpreter
,PyQt5.QtCore.QObject
Create a QObject from the
CommandInterpreter
.Reimplement the
make_signals()
to use only thecommand_logger
signals from the command_interpreter and useSignal
for the other signals¶ Name Signature Description command_done
bool these five signals are a Qt re-implementation of the signals described in the signals
command_string
int, str global_logger
int, str n_primaries
int progress
int, int, int, int finished
emitted when the run is finished ¶ Name Signature Description run()
Run the command Parameters: - parent :
PyQt5.QtWidgets.QWidget
instance 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.QAction
Action for the queue window.
Create the menu entry and binds signals known by the queue window to show/hide it
¶ Name Signature Description update_text()
bool change the text to show in the action item ¶ Signal Slot/Signal toggled
update_text()
Queue.closeSignal
toggle()
toggled
Queue.toggle()
Parameters: - *args, **kargs:
arguments passed to the parent class
-
vdat.gui.queue.
set_queue
(parent=None)[source]¶ Create a
Queue
instance and save it. You can access it withget_queue()
Parameters: - parent :
PyQt5.QtWidgets.QWidget
instance the parent widget
- parent :