Dear list,
I am using the X2Go Python API to develop a custom UI for running our applications from (mainly) Windows client machines.
When starting an application based on a session profile obtained from the X2Go broker, I am checking for the suspended sessions on the server by calling X2GoClient.list_sessions().
X2GoClient.list_sessions() returns the list of all sessions on the server, including also sessions of other profiles. I need to filter them out to include only the sessions of the same profile, which is currently starting.
The X2GoSessionInfo instances, however, don’t include the information I need. I need the profile name, profile id or at least the command. The command is included in the session name, but I don’t feel that parsing the session name is the right way to go.
Thus I tried to obtain more information about the session using X2GoClient.get_session_of_session_name(), but it returns None for all session names returned by X2GoClient.list_sessions().
I also tried to pass profile_name or profile_id to X2GoClient.list_sessions() but it is probably not meant to filter the sessions as I am still receiving the complete list of sessions including also sessions of other profiles.
So is there a way to find out the profile name, profile id or command of a suspended session returned by X2GoClient.list_sessions()?
Thank you for any advice.
Best regards
Tomas Cerha
Hi Tomas,
On Fr 18 Mai 2018 11:12:33 CEST, Tomáš Cerha wrote:
The point is that the profile names / profile IDs are client-side
only. Nothing on the server is aware of them.
What you can do is, you can write some code that matches settings of
the running session (all hidden in the session name string) with
matches in the local session profiles.
However, this mapping will and can never, in all thinkable generic
case, be bijective.
What I do in another project, I compare the commands that launched the
session. For this, I quite recently added this commit:
https://code.x2go.org/gitweb?p=python-x2go.git;a=commitdiff;h=f89baa4e4c810f...
Mike
--
DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby mobile: +49 (1520) 1976 148 landline: +49 (4354) 8390 139
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
HI once more,
On Fr 18 Mai 2018 11:12:33 CEST, Tomáš Cerha wrote:
While you work on broker and python-x2go, please provide improvements
to both projects, if you make any.
Esp. with python-x2go, don't work around missing features in your own
code. If your code solves a generic problem, please hack it into
python-x2go and send patches upstream.
Thanks!
Mike
--
DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby mobile: +49 (1520) 1976 148 landline: +49 (4354) 8390 139
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
The point is that the profile names / profile IDs are client-side only. Nothing on the server is aware of them.
Ok, it makes sense.
What I do in another project, I compare the commands that launched the session. For this, I quite recently added this commit: https://code.x2go.org/gitweb?p=python-x2go.git;a=commitdiff;h=f89baa4e4c810f... <https://code.x2go.org/gitweb?p=python-x2go.git;a=commitdiff;h=f89baa4e4c810f3f1b30e8ce080769d0f996fb43>
Yes, comparing the command should work in my case too. I just didn’t feel comfortable processing the session id on my side as I don’t know the exact logic of its creation (and I should not care). But when this processing is done on the side of python-x2go itself, I’m fine with that. Thank you for pointing this out!
Yes. Our client UI is quite specific, but I still have a few ideas for things, which might be useful generally.
Thank you for your help and for your work on python-x2go!
Best regards
Tomas
Hi Tomáš,
On Fr 25 Mai 2018 11:05:31 CEST, Tomáš Cerha wrote:
:-)
There can be more magic applied to the matching code. (E.g. color
depth matching, desktop or rootless session, etc.). If you need
anything like it, please hack that into python-x2go and provide your
patch.
Cool. Shov'em over...
Thank you for your help and for your work on python-x2go!
Welcome!
DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby mobile: +49 (1520) 1976 148 landline: +49 (4354) 8390 139
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
On Fr 25 Mai 2018 11:05:31 CEST, Tomáš Cerha wrote:
Thank you for your help and for your work on python-x2go!
One more thought... When developing with python-x2go, make sure you
use the python3-x2go version from the nightly builds... Don't hack
Python v2 code these days.
DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby mobile: +49 (1520) 1976 148 landline: +49 (4354) 8390 139
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de