Package x2go :: Module printqueue :: Class X2GoPrintQueue

[frames] | no frames]

# Class X2GoPrintQueue

source code

            object --+
                     |
    threading._Verbose --+
                         |
          threading.Thread --+
                             |
                            X2GoPrintQueue

If X2Go printing is supported in a particular X2GoSession instance this class provides a sub-thread for handling incoming X2Go print jobs.

Instance Methods

__init__(self, profile_name=`'``UNKNOWN``'`, session_name=`'``UNKNOWN``'`, spool_dir=None, print_action=None, print_action_args=`{``}`, client_instance=None, printing_backend=<class 'x2go.backends.printing._file.X2GoClientPrintingFILE'>, logger=None, loglevel=56) This constructor should always be called with keyword arguments. | source code

__del__(self) Class destructor. | source code

pause(self) Prevent acceptance of new incoming print jobs. | source code

resume(self) Resume operation of the X2Go print spooler and continue accepting new incoming print jobs. | source code

stop_thread(self) Stops this X2GoPrintQueue thread completely. | source code

set_print_action(self, print_action, **kwargs) Modify the print action of this X2GoPrintQueue thread during runtime. | source code

run(self) Start this X2GoPrintQueue thread... | source code

Inherited from `threading.Thread`: `__repr__`, `getName`, `isAlive`, `isDaemon`, `is_alive`, `join`, `setDaemon`, `setName`, `start` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Variables
| print_action = `None`
| spooldir = `None`
| active_jobs = ``{``}``
| job_history = ``[``]``

Properties
Inherited from `threading.Thread`: `daemon`, `ident`, `name` Inherited from `object`: `__class__`

Method Details

### __init__(self, profile_name=`'``UNKNOWN``'`, session_name=`'``UNKNOWN``'`, spool_dir=None, print_action=None, print_action_args=`{``}`, client_instance=None, printing_backend=<class 'x2go.backends.printing._file.X2GoClientPrintingFILE'>, logger=None, loglevel=56)
(Constructor)

source code

This constructor should always be called with keyword arguments. Arguments are:

*group* should be None; reserved for future extension when a ThreadGroup class is implemented.

*target* is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

*name* is the thread name. By default, a unique name is constructed of the form "Thread-N" where N is a small decimal number.

*args* is the argument tuple for the target invocation. Defaults to ().

*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

Parameters:
  - `profile_name` (`str`) - name of the session profile this print queue belongs to
  - `spool_dir` (`str`) - local spool directory for incoming print job files
  - `print_action` (`str` or instance) - name or instance of either of the possible X2Go print action classes
  - `print_action_args` - depending of the chosen `print_action` this dictionary may contain different values; the `print_action_args` will be passed on to the X2Go print action instance constructor, so refer to either of these: X2GoPrintActionPDFVIEW, X2GoPrintActionPRINT et al.
  - `client_instance` (`obj`) - the underlying X2GoClient instance
  - `printing_backend` (`obj`) - the client printing configuration backend class
  - `logger` (`obj`) - you can pass an X2GoLogger object to the X2GoPrintQueue constructor
  - `loglevel` (`int`) - if no X2GoLogger object has been supplied a new one will be constructed with the given loglevel
Overrides: object.__init__

### pause(self)

source code

Prevent acceptance of new incoming print jobs. The processing of print jobs that are currently still active will be completed, though.

### set_print_action(self, print_action, **kwargs)

source code

Modify the print action of this X2GoPrintQueue thread during runtime. The change of print action will be valid for the next incoming print job.

As kwargs you can pass arguments for the print action class to be set. Refer to the class descriptions of X2GoPrintActionDIALOG, X2GoPrintActionPDFVIEW, X2GoPrintActionPRINT, etc.

Parameters:
  - `print_action` (`str` or `class`) - new print action to be valid for incoming print jobs
  - `kwargs` (`dict`) - extra options for the specified print action

### run(self)

source code

Start this X2GoPrintQueue thread...

Overrides: threading.Thread.run