The X2GoClient implements _THE_ public Python X2Go API. With it you
can construct your own X2Go client application in Python.
Most methods in this class require that you have registered a session
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: X2GoClient.register_session() and X2GoClient.connect_session().
|
__init__(self,
control_backend=' PLAIN ' ,
terminal_backend=' PLAIN ' ,
info_backend=' PLAIN ' ,
list_backend=' PLAIN ' ,
proxy_backend=' NX3 ' ,
profiles_backend=' FILE ' ,
settings_backend=' FILE ' ,
printing_backend=' FILE ' ,
broker_url=None,
broker_password=None,
broker_noauth=False,
client_rootdir=None,
sessions_rootdir=None,
ssh_rootdir=None,
start_xserver=False,
start_pulseaudio=False,
use_cache=False,
use_listsessions_cache=False,
auto_update_listsessions_cache=False,
auto_update_listdesktops_cache=False,
auto_update_listmounts_cache=False,
auto_update_sessionregistry=False,
auto_register_sessions=False,
no_auto_reg_pubapp_sessions=False,
refresh_interval=5,
pulseaudio_installdir=' /builddir/build/BUILD/python-x2go-0.5.0.4/pulseaudio ' ,
logger=None,
loglevel=56)
x.__init__(...) initializes x; see help(type(x)) for signature |
source code
|
|
|
|
|
|
bool
|
|
|
|
|
|
|
|
|
HOOK_no_such_desktop(self,
profile_name=' UNKNOWN ' ,
desktop=' UNKNOWN ' )
HOOK method: called if it is tried to connect to a (seen before)
sharable desktop that's not available (anymore). |
source code
|
|
|
|
|
|
|
|
|
HOOK_no_such_command(self,
cmd,
profile_name=' UNKNOWN ' ,
session_name=' UNKNOWN ' )
HOOK: the command <cmd> is not available on the connected X2Go
server. |
source code
|
|
|
|
|
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. |
source code
|
|
bool
|
HOOK_check_host_dialog(self,
profile_name=' UNKNOWN ' ,
host=' UNKNOWN ' ,
port=22,
fingerprint=' no fingerprint ' ,
fingerprint_type=' UNKNOWN ' )
HOOK method: called if a host check is requested. |
source code
|
|
|
|
|
|
|
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. |
source code
|
|
|
HOOK_pulseaudio_server_startup_failed(self)
HOOK method: called if the Pulseaudio daemon startup failed. |
source code
|
|
|
HOOK_pulseaudio_server_died(self)
HOOK method: called if the Pulseaudio daemon has died away
unexpectedly. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
str
|
|
str
|
|
str
|
|
str
|
|
list
|
|
str
|
register_session(self,
server=None,
profile_id=None,
profile_name=None,
session_name=None,
allow_printing=False,
allow_share_local_folders=False,
share_local_folders=[ ] ,
allow_mimebox=False,
mimebox_extensions=[ ] ,
mimebox_action=' OPEN ' ,
add_to_known_hosts=False,
known_hosts=None,
forward_sshagent=False,
proxy_options={ } ,
return_object=False,
**kwargs)
Register a new X2GoSession. |
source code
|
|
|
|
str
|
|
tuple
|
|
str
|
|
obj
|
|
obj
|
|
str or X2GoSession instance
|
|
str
|
get_session_name(self,
session_uuid)
Retrieve the server-side X2Go session name for the session that has
been registered under session_uuid . |
source code
|
|
obj
|
get_session_info(self,
session_uuid)
Retrieve the server-side X2Go session information object for the
session that has been registered under session_uuid . |
source code
|
|
dict
|
get_published_applications(self,
session_uuid=None,
profile_name=None,
lang=None,
refresh=False,
raw=False,
very_raw=False,
max_no_submenus=10)
Retrieve the server-side X2Go published applications menu for the
session registered under session_uuid or for profile
name profile_name . |
source code
|
|
dict
|
profile_get_published_applications(self,
session_uuid=None,
profile_name=None,
lang=None,
refresh=False,
raw=False,
very_raw=False,
max_no_submenus=10)
Retrieve the server-side X2Go published applications menu for the
session registered under session_uuid or for profile
name profile_name . |
source code
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
session_uses_sshproxy(self,
session_uuid)
Check if session with unique identifier <session_uuid> is
configured to use an intermediate SSH proxy server. |
source code
|
|
bool
|
|
bool
|
session_can_auto_connect(self,
session_uuid)
Check if session with unique identifier <session_uuid> is
configured adequately to be able to auto-connect to the X2Go server
(e.g. |
source code
|
|
bool
|
|
bool
|
connect_session(self,
session_uuid,
username=None,
password=None,
passphrase=None,
sshproxy_user=None,
sshproxy_password=None,
sshproxy_passphrase=None,
add_to_known_hosts=False,
force_password_auth=False,
sshproxy_force_password_auth=False)
Connect to a registered X2Go session with registry hash
session_uuid This method basically wraps around
paramiko.SSHClient.connect() for the corresponding session. |
source code
|
|
|
|
|
set_session_print_action(self,
session_uuid,
print_action,
**kwargs)
If X2Go client-side printing is enable within an X2Go session you can
use this method to alter the way how incoming print spool jobs are
handled/processed. |
source code
|
|
|
|
|
|
|
|
bool
|
|
bool
|
share_desktop_session(self,
session_uuid,
desktop=None,
user=None,
display=None,
share_mode=0,
check_desktop_list=False,
**sessionopts)
Share another already running desktop session. |
source code
|
|
bool
|
resume_session(self,
session_uuid=None,
session_name=None,
match_profile_name=None,
**sessionopts)
Resume or continue a suspended / running X2Go session on a remote
X2Go server (as specified when register_session was called). |
source code
|
|
bool
|
suspend_session(self,
session_uuid,
session_name=None,
match_profile_name=None,
**sessionopts)
Suspend an X2Go session. |
source code
|
|
bool
|
|
str
|
|
str
|
|
bool
|
session_ok(self,
session_uuid)
Test if the X2Go session registered as session_uuid is
in a healthy state. |
source code
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
is_folder_sharing_available(self,
session_uuid=None,
profile_name=None)
Test if local folder sharing is available for X2Go session with
unique ID <session_uuid> or session profile
<profile_name>. |
source code
|
|
bool
|
share_local_folder(self,
session_uuid=None,
local_path=None,
profile_name=None,
folder_name=None)
Share a local folder with the X2Go session registered as
session_uuid . |
source code
|
|
bool
|
|
bool
|
|
bool
|
|
bool
|
unshare_local_folder(self,
session_uuid=None,
profile_name=None,
local_path=None)
Unshare local folder that is mounted in the X2Go session registered
as session_uuid . |
source code
|
|
bool
|
|
bool
|
|
list
|
get_shared_folders(self,
session_uuid=None,
profile_name=None,
check_list_mounts=False)
Get a list of local folders mounted within X2Go session with session
hash <session_uuid> from this client. |
source code
|
|
list
|
session_get_shared_folders(self,
session_uuid=None,
profile_name=None,
check_list_mounts=False)
Get a list of local folders mounted within X2Go session with session
hash <session_uuid> from this client. |
source code
|
|
list
|
profile_get_shared_folders(self,
session_uuid=None,
profile_name=None,
check_list_mounts=False)
Get a list of local folders mounted within X2Go session with session
hash <session_uuid> from this client. |
source code
|
|
list
|
get_master_session(self,
profile_name,
return_object=True,
return_session_name=False)
Retrieve the master session of a specific profile. |
source code
|
|
list
|
|
list
|
|
list
|
|
list
|
client_running_sessions(self,
return_objects=False,
return_profile_names=False,
return_profile_ids=False,
return_session_names=False)
Retrieve a list of running X2Go sessions. |
source code
|
|
list
|
client_suspended_sessions(self,
return_objects=False,
return_profile_names=False,
return_profile_ids=False,
return_session_names=False)
Retrieve a list of suspended X2Go sessions. |
source code
|
|
list
|
client_registered_sessions(self,
return_objects=True,
return_profile_names=False,
return_profile_ids=False,
return_session_names=False)
Retrieve a list of registered X2Go sessions. |
source code
|
|
X2GoControlSession instance
|
|
dict or str
|
get_server_versions(self,
profile_name,
component=None,
force=False)
Query the server configured in session profile <profile_name>
for the list of install X2Go components and its versions. |
source code
|
|
dict or str
|
get_server_components(self,
profile_name,
component=None,
force=False)
Query the server configured in session profile <profile_name>
for the list of install X2Go components and its versions. |
source code
|
|
list
|
get_server_features(self,
profile_name,
force=False)
Query the server configured in session profile <profile_name>
for the list of server-side X2Go features. |
source code
|
|
bool
|
has_server_feature(self,
profile_name,
feature)
Query the server configured in session profile <profile_name>
for the availability of a certain server feature. |
source code
|
|
X2GoSession or str
|
|
bool
|
|
list
|
|
list
|
|
list
|
|
list
|
|
list
|
|
list
|
|
bool
|
|
bool
|
|
str
|
|
list
|
|
bool
|
|
|
|
list
|
|
|
|
bool
|
|
|
clean_sessions(self,
session_uuid,
published_applications=False)
Find running X2Go sessions that have previously been started by the
connected user on the remote X2Go server and terminate them. |
source code
|
|
|
list_sessions(self,
session_uuid=None,
profile_name=None,
profile_id=None,
no_cache=False,
refresh_cache=False,
update_sessionregistry=True,
register_sessions=False,
raw=False)
Use the X2Go session registered under session_uuid to
retrieve a list of running or suspended X2Go sessions from the
connected X2Go server (for the authenticated user). |
source code
|
|
list
|
list_desktops(self,
session_uuid=None,
profile_name=None,
profile_id=None,
no_cache=False,
refresh_cache=False,
exclude_session_types=[ ] ,
raw=False)
Use the X2Go session registered under session_uuid to
retrieve a list of X2Go desktop sessions that are available for
desktop sharing. |
source code
|
|
list
|
list_mounts_by_profile_name(self,
profile_name,
no_cache=False,
refresh_cache=False,
raw=False)
For a given profil profile_name to retrieve its list of
mounted client shares for that session. |
source code
|
|
list
|
list_mounts(self,
session_uuid,
no_cache=False,
refresh_cache=False,
raw=False)
Use the X2Go session registered under session_uuid to
retrieve its list of mounted client shares for that session. |
source code
|
|
|
|
|
|
|
|
|
|
dict or bool , int ,
str
|
get_profile_config(self,
profile_id_or_name,
parameter=None)
Returns a dictionary with session options and values that represent
the session profile for profile_id_or_name . |
source code
|
|
dict or bool , int ,
str
|
with_profile_config(self,
profile_id_or_name,
parameter=None)
Returns a dictionary with session options and values that represent
the session profile for profile_id_or_name . |
source code
|
|
dict
|
set_profile_config(self,
profile_id_or_name,
parameter,
value)
Set individual session profile parameters for session profile
profile_id_or_name . |
source code
|
|
str
|
to_profile_id(self,
profile_name)
Retrieve the session profile ID of the session whose profile name is
profile_name |
source code
|
|
str
|
|
str
|
get_profile_metatype(self,
profile_name)
Evaluate a session profile and return a human readable meta type
(classification) for the session profile profile_name . |
source code
|
|
list
|
|
bool
|
|
|
|
|
|
|
update_sessionregistry_status_all_profiles(self)
Update the session registry stati of all session profiles. |
source code
|
|
|
update_cache_by_profile_name(self,
profile_name,
cache_types=' sessions ' ,
update_sessions=None,
update_desktops=None,
update_mounts=None)
Update the session list cache by profile name. |
source code
|
|
|
update_cache_by_session_uuid(self,
session_uuid,
cache_types=' sessions ' ,
update_sessions=None,
update_desktops=None,
update_mounts=None)
Update the session list cache of a specific X2GoSession instance with session identifier
<session_uuid>. |
source code
|
|
|
update_cache_all_profiles(self,
cache_types=' sessions ' ,
update_sessions=None,
update_desktops=None,
update_mounts=None)
Update the session list cache of all session profiles. |
source code
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|