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:
object
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’, ‘K’, ‘R’, ‘S’ or ‘P’).
- Returns:
session type
- Return type:
str
orNone
(if not initialized)
Get the share mode of a shadow session.
- Returns:
share mode (0: view-only, 1: full access),
None
when used for non-desktop-sharing sessions- Return type:
str
orNone
(if not initialized)
- get_status()[source]¶
Retrieve the session’s status from this session info data structure.
- Returns:
session status
- Return type:
str
orNone
(if not initalized)
- 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 = ‘’)
- is_desktop_session()[source]¶
Is this session a desktop session?
- Returns:
True
if this session is a desktop session,False
otherwise- Return type:
bool
orNone
(if not initialized)
- is_kdrive_session()[source]¶
Is this session a KDrive based desktop session?
- Returns:
True
if this session is a KDrive based desktop session,False
otherwise- Return type:
bool
- is_nx3_session()[source]¶
Is this session an NXv3 based desktop/rootless session?
- Returns:
True
if this session is a NXv3 based desktop/rootless session,False
otherwise- Return 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 provider- Return type:
bool
orNone
(if not initialized)
- is_running()[source]¶
Is this session running?
- Returns:
True
if the session is running,False
otherwise- Return type:
bool
orNone
(if not initialized)
- is_suspended()[source]¶
Is this session suspended?
- Returns:
True
if the session is suspended,False
otherwise- Return type:
bool
orNone
(if not initialized)
- 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:
object
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 name- Returns:
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 namevalue (
str
) – the resulting session has to match this value for<property_name>
hostname (
str
) – the result has to match this hostname (Default value = None)