x2go.backends.info.plain module¶
X2GoServerSessionList and X2GoServerSessionInfo classes - data handling for X2Go server sessions.
This backend handles X2Go server implementations that respond with session infos via server-side PLAIN text output.
-
class
x2go.backends.info.plain.
X2GoServerSessionInfo
[source]¶ Bases:
future.types.newobject.newobject
x2go.backends.info.plain.X2GoServerSessionInfo
is used to store all information that is retrieved from the connected X2Go server onX2GoTerminalSession.start()
resp.X2GoTerminalSession.resume()
.-
clear
()[source]¶ Clear all properties of a
x2go.backends.info.plain.X2GoServerSessionInfo
object.
-
get_session_type
()[source]¶ Get the session type (i.e. ‘D’, ‘R’, ‘S’ or ‘P’).
Returns: session type Return type: str
Get the share mode of a shadow session.
Returns: share mode (0: view-only, 1: full access), None
when used for non-desktop-sharing sessionsReturn type: str
-
get_status
()[source]¶ Retrieve the session’s status from this session info data structure.
Returns: session status Return type: str
-
initialize
(x2go_output, username='', hostname='', local_container='', remote_container='')[source]¶ Setup a a session info data block, includes parsing of X2Go server’s
x2gostartagent
stdout values.Parameters: - x2go_output (str) – X2Go server’s
x2gostartagent
command output, each value separated by a newline character. - username (str) – session user name (Default value = ‘’)
- hostname (str) – hostname of X2Go server (Default value = ‘’)
- local_container (str) – X2Go client session directory for config files, cache and session logs (Default value = ‘’)
- remote_container (str) – X2Go server session directory for config files, cache and session logs (Default value = ‘’)
- x2go_output (str) – X2Go server’s
-
is_desktop_session
()[source]¶ Is this session a desktop session?
Returns: True
if this session is a desktop session,False
otherwiseReturn type: bool
-
is_published_applications_provider
()[source]¶ Detect from session info if this session is a published applications provider.
Returns: returns True
if this session is a published applications providerReturn type: bool
-
is_running
()[source]¶ Is this session running?
Returns: True
if the session is running,False
otherwiseReturn type: bool
-
is_suspended
()[source]¶ Is this session suspended?
Returns: True
if the session is suspended,False
otherwiseReturn type: bool
-
update
(session_info)[source]¶ Update all properties of a
x2go.backends.info.plain.X2GoServerSessionInfo
object.Parameters: session_info ( X2GoServerSessionInfo*
) – a provided session info data structure
-
-
class
x2go.backends.info.plain.
X2GoServerSessionList
(x2go_output=None, info_backend=<class 'x2go.backends.info.plain.X2GoServerSessionInfo'>)[source]¶ Bases:
future.types.newobject.newobject
x2go.backends.info.plain.X2GoServerSessionList
is used to store all information that is retrieved from a connected X2Go server on aX2GoControlSession.list_sessions()
call.-
get_session_info
(session_name)[source]¶ Retrieve the session information for
<session_name>
.Parameters: session_name ( str
) – the queried session nameReturns: the session info of <session_name>
Return type: X2GoServerSessionInfo*
orNone
-
get_session_with
(property_name, value, hostname=None)[source]¶ Find session with a given display number on a given host.
Parameters: - property_name (
str
) – match a session based on this property name - value (
str
) – the resulting session has to match this value for<property_name>
- hostname (
str
) – the result has to match this hostname (Default value = None)
- property_name (
-