Package x2go :: Module cleanup

[frames] | no frames]

# Module cleanup

source code

A recommended X2Go session clean up helper function.

Functions

x2go_cleanup(e=None, threads=None) For every Python X2Go application you write, please make sure to capture the `KeyboardInterrupt` and the `SystemExit` exceptions and call this function if either of the exceptions occurs. | source code

Variables
| __package__ = ``'``x2go``'``

Function Details

### x2go_cleanup(e=None, threads=None)

source code

For every Python X2Go application you write, please make sure to capture the `KeyboardInterrupt` and the `SystemExit` exceptions and call this function if either of the exceptions occurs.

Example:

       import x2go

       try:
           my_x2goclient = x2go.X2GoClient(...)

           [... your code ...]

           sys.exit(0)
       except (KeyboardInterrupt, SystemExit):
           x2go.x2go_cleanup()

Parameters:
  - `e` (`exception`) - if x2go_cleanup got called as you caught an exception in your code this can be the `Exception` that we will process at the end of the clean-up (or if clean-up failed or was not appropriate)
  - `threads` (`list`) - a list of threads to clean up