[X2go-Commits] pyhoca-cli.git - master (branch) updated: 0.1.4.1-7-gd5c1ff7
X2go dev team
git-admin at x2go.org
Wed Aug 17 02:26:56 CEST 2011
The branch, master has been updated
via d5c1ff7f2e31a150aa241acd7317fabb940e5439 (commit)
via 1d7da12b3de5787b7ada39333601bccbe50f4c5c (commit)
from 37ba4e6f7dfa24bf27cab76c6588344da5a6b4a4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d5c1ff7f2e31a150aa241acd7317fabb940e5439
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Wed Aug 17 02:28:02 2011 +0200
Update+rearrange man page.
commit 1d7da12b3de5787b7ada39333601bccbe50f4c5c
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Wed Aug 17 02:27:57 2011 +0200
Add cmd line option --terminate-on-ctrl-c.
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 1 +
man/man1/pyhoca-cli.1 | 22 +++++++++++++++-------
pyhoca-cli | 1 +
pyhoca/cli/frontend.py | 8 ++++++++
4 files changed, 25 insertions(+), 7 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 981b6c5..17142c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ pyhoca-cli (0.1.4.2-0~x2go1) UNRELEASED; urgency=low
all sessions of the connecting user.
- Allow ,,NEWEST'' and ,,OLDEST'' as session name when resuming (closes
upstream issue #86).
+ - Add cmd line option --terminate-on-ctrl-c.
-- Mike Gabriel <mike.gabriel at das-netzwerkteam.de> Wed, 06 Jul 2011 22:18:01 +0200
diff --git a/man/man1/pyhoca-cli.1 b/man/man1/pyhoca-cli.1
index 8911f3b..35678ff 100644
--- a/man/man1/pyhoca-cli.1
+++ b/man/man1/pyhoca-cli.1
@@ -54,10 +54,16 @@ Enable debugging code of the unterlying Python X2go module.
.TP
\*(T<\fB\-\-libdebug-sftpxfer\fR\*(T>
Enable debugging code of Python X2go's sFTP server code (very verbose, and it may even reveal promiscuous data).
-.SH SERVER
+.SH SERVER / SESSION PROFILE
+You either have to specify a server name or a pre-configured X2goClient session profile to tell \fBpyhoca-cli\fR to
+what X2go server to connect. \fBpyhoca-cli\fR will not start
+if neither of these two options has been given on the command line.
.TP
\*(T<\fB\-\-server\fR \fI<HOSTNAME_or_IP>\fR\*(T>
If not in LDAP mode you always have to name the remote X2go server's hostname or IP address.
+.TP
+\*(T<\fB\-P, \-\-session-profile\fR \fI<SESSION_PROFILE_NAME>\fR\*(T>
+The name of the session profile to be used to make the connection.
.SH ACTIONS
\fBpyhoca-cli\fR accepts exclusively one of the listed actions:
.TP
@@ -81,11 +87,16 @@ Terminate running X2go session <SESSION_NAME>. A special value for <SESSION_NAME
.TP
\*(T<\fB\-L, \-\-list-sessions\fR\*(T>
List user's X2go sessions on server.
+.SH ACTION OPTIONS
+\fBpyhoca-cli\fR actions can be tweaked by these options:
+.TP
+\*(T<\fB\-\-clean-sessions\fR\*(T>
+Clean all of the user's suspended/running sessions before starting a new one on the named X2go server.
+.TP
+\*(T<\fB\-\-terminate-on-ctrl-c\fR\*(T>
+Terminate the connected session when pressing CTRL+C (instead of suspending the session).
.SH X2GO OPTIONS
.TP
-\*(T<\fB\-P, \-\-session-profile\fR\*(T>
-The name of the session profile to be used to make the connection.B
-.TP
\*(T<\fB\-c, \-\-command\fR \fI<CMD>\fR\*(T>
Command to run with \fB\-\-new\fR mode on server (default: xterm).
.TP
@@ -117,9 +128,6 @@ Use X2go printing (default: disabled).
.TP
\*(T<\fB\-\-share-mode\fR \fI{0|1}\fR\*(T>
Share mode for X2go desktop sharing (0: view-only, 1: full access).
-.TP
-\*(T<\fB\-\-clean-sessions\fR\*(T>
-Clean all of the user's suspended/running sessions before starting a new one on the named X2go server.
.TP
\*(T<\fB\-\-time-to-wait\fR\*(T>
Time to wait for session startup/resume (default: 8s). There should be no need to touch this, unless on very slow network connections.
diff --git a/pyhoca-cli b/pyhoca-cli
index 71f7591..741f9cd 100755
--- a/pyhoca-cli
+++ b/pyhoca-cli
@@ -122,6 +122,7 @@ x2go_options = [
{'args':['--share-mode'], 'default': 0, 'help': 'share mode for X2go desktop sharing (0: view-only, 1: full access)', },
{'args':['-F', '--share-local-folders'], 'metavar': '<folder1>[,<folder2[,...]]', 'default': None, 'help': 'a comma separated list of local folder names to mount in the X2go session', },
{'args':['--clean-sessions'], 'default': False, 'action': 'store_true', 'help': 'clean all suspended sessions before starting a new one', },
+ {'args':['--terminate-on-ctrl-c'], 'default': False, 'action': 'store_true', 'help': 'terminate the connected session when pressing CTRL+C (instead of suspending the session)', },
{'args':['--time-to-wait'], 'default': '8', 'help': 'time to wait for session startup/resume (default: 8s)', },
]
print_options = [
diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py
index 82487d4..e5b3672 100644
--- a/pyhoca/cli/frontend.py
+++ b/pyhoca/cli/frontend.py
@@ -441,6 +441,8 @@ class PyHocaCLI(x2go.X2goClient):
self._pyhoca_logger("X2go session name is: %s" % session_name, loglevel=x2go.loglevel_INFO, )
if self.args.share_desktop:
self._pyhoca_logger("Press CTRL+C to end desktop sharing for this session...", loglevel=x2go.loglevel_NOTICE, )
+ elif self.args.terminate_on_ctrl_c:
+ self._pyhoca_logger("Press CTRL+C to terminate the running session...", loglevel=x2go.loglevel_NOTICE, )
else:
self._pyhoca_logger("Press CTRL+C to suspend the running session...", loglevel=x2go.loglevel_NOTICE, )
@@ -469,6 +471,12 @@ class PyHocaCLI(x2go.X2goClient):
self._X2goClient__terminate_session(self.x2go_session_hash)
time.sleep(2)
self._pyhoca_logger("X2go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
+ elif self.args.terminate_on_ctrl_c:
+ self._pyhoca_logger("Terminating X2go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
+ self._X2goClient__terminate_session(self.x2go_session_hash)
+ # giving nxproxy's SSH tunnel some time to settle
+ time.sleep(2)
+ self._pyhoca_logger("X2go session %s has been terminated" % session_name, loglevel=x2go.loglevel_NOTICE, )
else:
self._pyhoca_logger("Suspending X2go session %s" % session_name, loglevel=x2go.loglevel_INFO, )
self._X2goClient__suspend_session(self.x2go_session_hash)
hooks/post-receive
--
pyhoca-cli.git (Python X2go Client (command line client))
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "pyhoca-cli.git" (Python X2go Client (command line client)).
More information about the x2go-commits
mailing list