[X2Go-Commits] [x2goclient] 11/94: * added --session-profile option (run a session profile as configured in ~/.x2goclient/sessions)
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 15 21:04:31 CET 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to annotated tag 0.1.4.0
in repository x2goclient.
commit a077a980c6b5e7e2bd4b09c62c4c29fe590a9b1b
Author: mike <mike at cdb5e8f1-f799-4276-8919-bce57fd91830>
Date: Sun Nov 7 00:34:00 2010 +0000
* added --session-profile option (run a session profile as configured in ~/.x2goclient/sessions)
git-svn-id: https://svn.das-netzwerkteam.de/x2go/pyhoca-cli/trunk@31 cdb5e8f1-f799-4276-8919-bce57fd91830
---
pyhoca-cli | 4 ++++
pyhoca/cli/frontend.py | 20 ++++++++++----------
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/pyhoca-cli b/pyhoca-cli
index 974f7856..aedcdaa4 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -203,6 +203,10 @@ Possible values for the --pack NX option are:
if not x2go.utils.is_in_nx3packmethods(a.pack):
runtime_error("unknown pack method '%s'" % args.pack, parser=p, exitcode=10)
+ else:
+ if not (a.resume or a.suspend or a.terminate or a.list_sessions):
+ a.new = True
+
# X2go printing
if ((a.pdfview_cmd and a.printer) or
(a.pdfview_cmd and a.save_to_folder) or
diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py
index 11ff709a..5546e41a 100644
--- a/pyhoca/cli/frontend.py
+++ b/pyhoca/cli/frontend.py
@@ -118,7 +118,10 @@ class PyHocaCLI(x2go.X2goClient):
"""
# start a new session and run a command
self.logger('starting a new X2go session', x2go.loglevel_INFO, )
- self.logger('Command for new session is: %s' % self.args.command, x2go.loglevel_DEBUG, )
+ if self.args.session_profile is None:
+ self.logger('command for new session is: %s' % self.args.command, loglevel=x2go.loglevel_DEBUG, )
+ else:
+ self.logger('command from session profile to run is: %s' % self.session_registry(self.x2go_session_hash).session_params['cmd'], loglevel=x2go.loglevel_DEBUG, )
self._X2goClient__start_session(s_hash)
@@ -176,12 +179,12 @@ class PyHocaCLI(x2go.X2goClient):
self.logger('preparing requested X2go session', x2go.loglevel_NOTICE, )
x2go.X2goClient.__init__(self, logger=liblogger)
- _profile_id = None
- if self.args.session_profile:
- self.load_session_profiles()
- _profile_id = self.get_profile_id(self.args.session_profile)
- if not _profile_id:
+ if self.args.session_profile and self.has_session_profile(self.args.session_profile):
+
+ self.x2go_session_hash = self.register_session(profile_name=self.args.session_profile)
+
+ else:
self.x2go_session_hash = self.register_session(args.server, port=int(self.args.remote_ssh_port),
username=self.args.username,
@@ -202,9 +205,6 @@ class PyHocaCLI(x2go.X2goClient):
print_action_args=self.args.print_action_args,
share_local_folders=self.args.share_local_folders,
cmd=self.args.command)
- else:
-
- self.x2go_session_hash = self.register_session(profile_id = _profile_id)
self.with_session(self.x2go_session_hash).load_host_keys(ssh_known_hosts_filename)
@@ -256,7 +256,7 @@ class PyHocaCLI(x2go.X2goClient):
self.new_session(self.x2go_session_hash)
# finally call the MainLoop of PyHocaCLI
- if not (self.args.new or self.args.resume):
+ if not (self.args.new or self.args.resume or self.args.session_profile):
sys.exit(0)
# give the session some time to come up...
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list