The branch, build-baikal has been updated via f085f47043f003f1c6123b8cd3d65582b223f0f2 (commit) from 49529de671fb76aa6c75407dec5ee4e82c1dc27b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: x2go/client.py | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 229 insertions(+), 1 deletion(-) The diff of changes is: diff --git a/x2go/client.py b/x2go/client.py index f030a2d..2c69158 100644 --- a/x2go/client.py +++ b/x2go/client.py @@ -175,6 +175,7 @@ class X2goClient(object): with a remote X2go server (passing of session options, initialization of the session object etc.) and connected to it (authentication). For these two steps use these methods: L{X2goClient.register_session()} and L{X2goClient.connect_session()}. + """ def __init__(self, control_backend=control.X2goControlSession, @@ -198,6 +199,44 @@ class X2goClient(object): pulseaudio_installdir=os.path.join(os.getcwd(), 'pulseaudio'), logger=None, loglevel=log.loglevel_DEFAULT): """\ + @param control_backend: X2go control session backend to use + @type control_backend: C{class} + @param terminal_backend: X2go terminal session backend to use + @type terminal_backend: C{class} + @param info_backend: X2go session info backend to use + @type info_backend: C{class} + @param list_backend: X2go session list backend to use + @type list_backend: C{class} + @param proxy_backend: X2go proxy backend to use + @type proxy_backend: C{class} + @param profiles_backend: X2go session profiles backend to use + @type profiles_backend: C{class} + @param settings_backend: X2go client settings backend to use + @type settings_backend: C{class} + @param printing_backend: X2go client printing backend to use + @type printing_backend: C{class} + @param client_rootdir: client base dir (default: ~/.x2goclient) + @type client_rootdir: C{str} + @param sessions_rootdir: sessions base dir (default: ~/.x2go) + @type sessions_rootdir: C{str} + @param ssh_rootdir: ssh base dir (default: ~/.ssh) + @type ssh_rootdir: C{str} + @param start_xserver: start XServer when registering an L{X2goClient} instance + @type start_xserver: C{bool} + @param start_pulseaudio: start PulseAudio daemon when registering an L{X2goClient} instance + @type start_pulseaudio: C{bool} + @param use_listsessions_cache: activate the X2go list sessions cache (L{X2goListSessionsCache}) + @type use_listsessions_cache: C{bool} + @param auto_update_listsessions_cache: activate automatic updates of the X2go list sessions cache (L{X2goListSessionsCache}) + @type auto_update_listsessions_cache: C{bool} + @param auto_update_sessionregistry: activate automatic updates of the X2go session registry + @type auto_update_sessionregistry: C{bool} + @param auto_register_sessions: activate automatic X2go session registration + @type auto_register_sessions: C{bool} + @param refresh_interval: refresh list sessions cache and session status every C{<refresh_interval} seconds + @type refresh_interval: C{int} + @param pulseaudio_installdir: install path of Pulseaudio binary + @type pulseaudio_installdir: C{str} @param logger: you can pass an L{X2goLogger} object to the L{X2goClient} constructor @type logger: L{X2goLogger} instance @@ -283,68 +322,257 @@ class X2goClient(object): # user hooks for detecting/notifying what happened during application runtime def HOOK_no_known_xserver_found(self): - self.logger('the Python X2go module could not find any usable XServer application, you will not be able to start X2go sessions without XServer', loglevel=log.loglevel_WARN) + """\ + HOOK method: called if the Python X2go module could not find any usable XServer + application to start. You will not be able to start X2go sessions without an XServer. + + """ + self.logger('the Python X2go module could not find any usable XServer application, you will not be able to start X2go sessions without an XServer', loglevel=log.loglevel_WARN) def HOOK_open_print_dialog(self, profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if an incoming print job has been detected by X2goClient and a print dialog box is + detected. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_open_print_dialog: incoming print job detected by X2goClient hook method', loglevel=log.loglevel_WARN) def HOOK_no_such_command(self, cmd, profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK: the command <cmd> is not available for X2go server. + + @param cmd: the command that failed + @type cmd: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_no_such_command: the command %s is not available for X2go server (profile: %s, session: %s)' % (cmd, profile_name, session_name), loglevel=log.loglevel_WARN) def HOOK_open_mimebox_saveas_dialog(self, filename, profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called on detection of an incoming MIME box job ,,<filename>''. + + @param filename: file name of the incoming MIME box job + @type filename: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_open_mimebox_saveas_dialog: incoming MIME box job ,, %s'' detected by X2goClient hook method' % filename, loglevel=log.loglevel_WARN) def HOOK_printaction_error(self, filename, profile_name='UNKNOWN', session_name='UNKNOWN', err_msg='GENERIC_ERROR', printer=None): + """\ + HOOK method: called if an incoming print job caused an error. + + @param filename: file name of the print job that failed + @type filename: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + @param err_msg: if available, an appropriate error message + @type err_msg: C{str} + @param printer: if available, the printer name the print job failed on + @type printer: C{str} + + """ if printer: self.logger('HOOK_printaction_error: incoming print job ,, %s'' on printer %s caused error: %s' % (filename, printer, err_msg), loglevel=log.loglevel_ERROR) else: self.logger('HOOK_printaction_error: incoming print job ,, %s'' caused error: %s' % (filename, err_msg), loglevel=log.loglevel_ERROR) def HOOK_check_host_dialog(self, profile_name='UNKNOWN', host='UNKNOWN', port=22, fingerprint='no fingerprint', fingerprint_type='RSA'): + """\ + HOOK method: called if a host check is requested. This hook has to either return C{true} (default) or C{false}. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param host: SSH server name to validate + @type host: C{str} + @param port: SSH server port to validate + @type port: C{int} + @param fingerprint: the server's fingerprint + @type fingerprint: C{str} + @param fingerprint_type: finger print type (like RSA, DSA, ...) + @type fingerprint_type: C{str} + @return: if host validity is verified, the hook method should return C{true} + @rtype: C{bool} + + """ self.logger('HOOK_check_host_dialog: host check requested for session profile %s: Automatically adding host [%s]:%s with fingerprint: ,,%s\'\' as a known host.' % (profile_name, host, port, fingerprint), loglevel=log.loglevel_WARN) # this HOOK has to return either True (accept host connection) or False (deny host conection) return True def HOOK_on_control_session_death(self, profile_name): + """\ + HOOK method: called if a control session (server connection) has unexpectedly encountered a failure. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + + """ self.logger('HOOK_on_control_session_death: the control session of profile %s has died unexpectedly' % profile_name, loglevel=log.loglevel_WARN) def HOOK_pulseaudio_not_supported_in_RDPsession(self): + """HOOK method: called if trying to run the Pulseaudio daemon within an RDP session, which is not supported by Pulseaudio.""" self.logger('HOOK_pulseaudio_not_supported_in_RDPsession: The pulseaudio daemon cannot be used within RDP sessions', loglevel=log.loglevel_WARN) def HOOK_pulseaudio_server_startup_failed(self): + """HOOK method: called if the Pulseaudio daemon startup failed.""" self.logger('HOOK_pulseaudio_server_startup_failed: The pulseaudio daemon could not be started', loglevel=log.loglevel_ERROR) def HOOK_pulseaudio_server_died(self): + """HOOK method: called if the Pulseaudio daemon has died away unexpectedly.""" self.logger('HOOK_pulseaudio_server_died: The pulseaudio daemon has just died away', loglevel=log.loglevel_ERROR) def HOOK_on_sound_tunnel_failed(self, profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a sound tunnel setup failed. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_sound_tunnel_failed: setting up X2go sound for %s (%s) support failed' % (profile_name, session_name)) def HOOK_rforward_request_denied(self, profile_name='UNKNOWN', session_name='UNKNOWN', server_port=0): + """\ + HOOK method: called if a reverse port forwarding request has been denied. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + @param server_port: remote server port (starting point of reverse forwarding tunnel) + @type server_port: C{str} + + """ self.logger('TCP port (reverse) forwarding request for session %s to server port %s has been denied by the X2go server. This is a common issue with SSH, it might help to restart the X2go server\'s SSH daemon.' % (session_name, server_port), loglevel=log.loglevel_WARN) def HOOK_forwarding_tunnel_setup_failed(self, profile_name='UNKNOWN', session_name='UNKNOWN', chain_host='UNKNOWN', chain_port=0): + """\ + HOOK method: called if a forwarding tunnel setup failed. + + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + @param chain_host: hostname of chain host (forwarding tunnel end point) + @type chain_host: C{str} + @param chain_port: port of chain host (forwarding tunnel end point) + @type chain_port: C{str} + + """ self.logger('Forwarding tunnel request to [%s]:%s for session %s (%s) was denied by remote X2go/SSH server. Session startup failed.' % (chain_host, chain_port, self.session_name, self.profile_name), loglevel=log.loglevel_ERROR) def HOOK_on_session_has_started_by_me(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been started by this instance of L{X2goClient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_started_by_me (session_uuid: %s, profile_name: %s): a new session %s has been started by this application' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def HOOK_on_session_has_started_by_other(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been started by another C{x2goclient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_started (session_uuid: %s, profile_name: %s): a new session %s has started been started by other application' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def HOOK_on_session_has_resumed_by_me(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been resumed by this instance of L{X2goClient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_resumed_by_me (session_uuid: %s, profile_name: %s): suspended session %s has been resumed by this application' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def HOOK_on_session_has_resumed_by_other(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been resumed by another C{x2goclient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_resumed_by_other (session_uuid: %s, profile_name: %s): suspended session %s has been resumed by other application' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def HOOK_on_found_session_running_after_connect(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called after server connect if an already running session has been found. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_found_session_running_after_connect (session_uuid: %s, profile_name: %s): running session %s has been found after connecting to session profile %s' % (session_uuid, profile_name, session_name, profile_name), loglevel=log.loglevel_NOTICE) def HOOK_on_session_has_been_suspended(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been suspended by this instance of L{X2goClient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_been_suspended (session_uuid: %s, profile_name: %s): session %s has been suspended' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def HOOK_on_session_has_terminated(self, session_uuid='UNKNOWN', profile_name='UNKNOWN', session_name='UNKNOWN'): + """\ + HOOK method: called if a session has been suspended by another C{x2goclient}. + + @param session_uuid: unique session identifier of the calling session + @type session_uuid: C{str} + @param profile_name: profile name of session that called this hook method + @type profile_name: C{str} + @param session_name: X2go session name + @type session_name: C{str} + + """ self.logger('HOOK_on_session_has_terminated (session_uuid: %s, profile_name: %s): session %s has terminated' % (session_uuid, profile_name, session_name), loglevel=log.loglevel_NOTICE) def _detect_backend_classes(self): hooks/post-receive -- python-x2go.git (Python X2Go Client API) This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "python-x2go.git" (Python X2Go Client API).