x2go.mimebox module¶
x2go.mimebox.X2GoMIMEboxQueue
sets up a thread that listens for incoming files that
shall be opened locally on the client.
For each file that gets dropped in the MIME box an individual
thread is started (x2go.mimebox.X2GoMIMEboxJob
) that handles the processing
of the incoming file.
- class x2go.mimebox.X2GoMIMEboxJob(**kwargs)[source]¶
Bases:
Thread
For each X2Go MIME box job we create a sub-thread that let’s the MIME box job be processed in the background.
As a handler for this class the function
x2go_mimeboxjob_handler()
is used.
- class x2go.mimebox.X2GoMIMEboxQueue(profile_name='UNKNOWN', session_name='UNKNOWN', mimebox_dir=None, mimebox_action=None, mimebox_extensions=[], client_instance=None, logger=None, loglevel=56)[source]¶
Bases:
Thread
If the X2Go MIME box is supported in a particaluar
x2go.session.X2GoSession
instance this class provides a sub-thread for handling incoming files in the MIME box directory. The actual handling of a dropped file is handled by the classesx2go.mimeboxactions.X2GoMIMEboxActionOPEN
,x2go.mimeboxactions.X2GoMIMEboxActionOPENWITH
andx2go.mimeboxactions.X2GoMIMEboxActionSAVEAS
.- active_jobs = {}¶
- mimebox = None¶
- mimebox_action = None¶
- mimebox_history = []¶
- pause()[source]¶
Prevent acceptance of new incoming files. The processing of MIME box jobs that are currently still active will be completed, though.
- resume()[source]¶
Resume operation of the X2Go MIME box queue and continue accepting new incoming files.
- run()[source]¶
This method gets called once the
x2go.mimebox.X2GoMIMEboxQueue
thread is started by theX2GoMIMEboxQueue.start()
method.
- set_mimebox_action(mimebox_action, **kwargs)[source]¶
Modify the MIME box action of this
x2go.mimebox.X2GoMIMEboxQueue
thread during runtime. The change of the MIME box action will be valid for the next incoming file in the MIME box directory.- Parameters:
mimebox_action (
str
orobj
) – the MIME box action to execute for incoming fileskwargs (
dict
) – extra options for the specified MIME box action
- stop_thread()[source]¶
Stops this
x2go.mimebox.X2GoMIMEboxQueue
thread completely.
- x2go.mimebox.x2go_mimeboxjob_handler(mimebox_file=None, mimebox_extensions=[], mimebox_action=None, parent_thread=None, logger=None)[source]¶
This function is called as a handler function for each incoming X2Go MIME box file represented by the class
x2go.mimebox.X2GoMIMEboxJob
.- Parameters:
mimebox_file (
str
) – MIME box file name as placed in to the X2Go MIME box spool directory (Default value = None)mimebox_action (
X2GoMIMEboxActionXXX
nstance) – an instance of either of the possibleX2GoMIMEboxActionXXX
classes (Default value = None)mimebox_extensions (
list
) – filter out files whose file extension is not in this list (Default value = [], means: no filtering)parent_thread (
obj
) – thex2go.mimebox.X2GoMIMEboxQueue
thread that actually created this handler’sx2go.mimebox.X2GoMIMEboxJob
instance (Default value = None)logger (
obj
) – thex2go.mimebox.X2GoMIMEboxQueue
’s logging instance (Default value = None)