[X2Go-Commits] pyhoca-gui.git - twofactorauth (branch) updated: fbae321182ab345348ad090b202a86fbc9241bd3

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:54:22 CEST 2013


The branch, twofactorauth has been updated
       via  fbae321182ab345348ad090b202a86fbc9241bd3 (commit)
      from  5d01759d449b367c3ddafaf76d7863d37ca8ec87 (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 -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 pyhoca-gui               |   32 ++++++++++++++++++++++++++++++--
 pyhoca/wxgui/frontend.py |    5 ++++-
 2 files changed, 34 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/pyhoca-gui b/pyhoca-gui
index cda3bab..5f78d89 100755
--- a/pyhoca-gui
+++ b/pyhoca-gui
@@ -53,6 +53,16 @@ import x2go
 
 from pyhoca.wxgui import PyHocaGUI
 
+# sometimes we have to fail...
+def runtime_error(m, parser=None, exitcode=-1):
+    """\
+    STILL UNDOCUMENTED
+    """
+    if parser is not None:
+        parser.print_usage()
+    sys.stderr.write ("%s: error: %s\n" % (os.path.basename(sys.argv[0]), m))
+    sys.exit(exitcode)
+
 # version information
 PROG_NAME = os.path.basename(sys.argv[0])
 PROG_PID  = os.getpid()
@@ -71,6 +81,11 @@ VERSION: %s
 __author__ = "Dick J. Kniep, Mike Gabriel"
 __version__ = _version
 
+if x2go.X2GOCLIENT_OS == 'Windows':
+    _x = x2go.xserver.X2goClientXConfig()
+    _known_xservers = _x.known_xservers
+    _installed_xservers = _x.installed_xservers
+
 # debug options...
 debug_options =  [
                    {'args':['-d','--debug'], 'default': False, 'action': 'store_true', 'help': 'enable application debugging code', },
@@ -90,6 +105,10 @@ x2go_gui_options = [
                    {'args':['--disable-options'], 'default': False, 'action': 'store_true', 'help': 'disable the client options configuration window', },
                    {'args':['--disable-profilemanager'], 'default': False, 'action': 'store_true', 'help': 'disable the session profile manager window', },
                  ]
+xserver_options = [
+                   {'args':['--start-xserver'], 'default': False, 'action': 'store_true', 'help': 'start the XServer before starting PyHoca-GUI, detect best XServer automatically, if more than one XServer is installed on your system', },
+                   {'args':['-X', '--preferred-xserver'], 'default': None, 'metavar': 'XSERVER', 'choices': _known_xservers, 'help': 'start either of the currently supported XServers: %s -- make sure your preferred XServer is installed on your system' % _known_xservers, },
+    ]
 
 def parseargs():
 
@@ -97,13 +116,17 @@ def parseargs():
     global print_action_args
 
     p = argparse.ArgumentParser(description='Graphical X2go client implemented in (wx)Python.',\
-                                epilog="""Possible values for the --pack NX option are:""", \
                                 formatter_class=argparse.RawDescriptionHelpFormatter, \
                                 add_help=True, argument_default=None)
     p_debugopts = p.add_argument_group('debug options')
     p_guiopts = p.add_argument_group('PyHoca GUI options')
+    p_xserveropts = p.add_argument_group('XServer options (MS Windows only)')
 
-    for (p_group, opts) in ((p_guiopts, x2go_gui_options), (p_debugopts, debug_options)):
+    if x2go.X2GOCLIENT_OS == 'Windows':
+        _option_groups = ((p_guiopts, x2go_gui_options), (p_debugopts, debug_options), (p_xserveropts, xserver_options))
+    else:
+        _option_groups = ((p_guiopts, x2go_gui_options), (p_debugopts, debug_options))
+    for (p_group, opts) in _option_groups:
         required = False
         for opt in opts:
 
@@ -131,6 +154,11 @@ def parseargs():
     if a.username is None:
         a.username = x2go.CURRENT_LOCAL_USER
 
+    if x2go.X2GOCLIENT_OS == 'Windows' and a.preferred_xserver:
+        if a.preferred_xserver not in _installed_xservers:
+            runtime_error('Xserver ,,%s\'\' is not installed on your Windows system' % a.preferred_xserver, parser=p)
+        a.start_xserver = a.preferred_xserver
+
     return a, logger, liblogger
 
 # print version text and exit
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index bb498da..085f68b 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -106,7 +106,10 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         wx.SplashScreen(splash_bitmap, wx.SPLASH_CENTRE_ON_SCREEN|wx.SPLASH_TIMEOUT, 3000, None, style=wx.SIMPLE_BORDER|wx.STAY_ON_TOP)
         wx.Yield()
 
-        x2go.X2goClient.__init__(self, logger=self._pyhoca_liblogger)
+        if x2go.X2GOCLIENT_OS == 'Windows':
+            x2go.X2goClient.__init__(self, start_xserver=self.args.start_xserver, logger=self._pyhoca_liblogger)
+        else:
+            x2go.X2goClient.__init__(self, logger=self._pyhoca_liblogger)
 
         self.SetAppName(self.appname)
         self.SetVendorName(self.vendorname)


hooks/post-receive
-- 
pyhoca-gui.git (Python X2Go Client (wxPython GUI))

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-gui.git" (Python X2Go Client (wxPython GUI)).




More information about the x2go-commits mailing list