[X2Go-Commits] pyhoca-gui.git - build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d (branch) updated: 0.0.31.0-83-gd28d2f6

X2Go dev team git-admin at x2go.org
Tue Aug 27 13:21:24 CEST 2013


The branch, build-59a18b6e3b5d3f1dd8f07f26433d37fe5984a57d has been updated
       via  d28d2f620abe324550c5d809469ef02ae8c84ec9 (commit)
      from  022811f7ea1033c3f4a2e17c6c95e4f1bf71f776 (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/wxgui/frontend.py |   14 ++++++++++++++
 pyhoca/wxgui/logon.py    |   13 +++++++++++++
 2 files changed, 27 insertions(+)

The diff of changes is:
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index ca8636f..c910662 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -324,6 +324,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
             self._start_on_connect(evt, session_uuid)
 
     def _do_authenticate(self, evt, session_uuid):
+        connect_failed = False
         profile_name = self.current_profile_name
         try:
             self._X2goClient__connect_session(session_uuid)
@@ -347,27 +348,40 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         except x2go.SSHException, e:
             self.notifier.send(_(u'%s - connect error') % profile_name, '%s!' % str(e), icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except x2go.X2goHostKeyException, e:
             self.notifier.send(_(u'%s - host key error') % profile_name, '%s!' % _(u'The remote server\'s host key is invalid or has not been accepted by the user'), icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except x2go.X2goSSHProxyHostKeyException, e:
             self.notifier.send(_(u'%s - host key error') % profile_name, '%s!' % _(u'The SSH proxy\'s host key is invalid or has not been accepted by the user'), icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except gevent.dns.DNSError, e:
             self.notifier.send(_(u'%s - connect error') % profile_name, '%s!' % e.strerror, icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except gevent.socket.error, e:
             self.notifier.send(_(u'%s - connect error') % profile_name, '%s!' % e.strerror, icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except EOFError, e:
             self.notifier.send(_(u'%s - connect error') % profile_name, _(u'Authentication protocol communication incomplete! Try again...'), icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except x2go.X2goSSHProxyException, e:
             self.notifier.send(_(u'%s - auth key error') % profile_name, '%s!' % str(e), icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
         except:
             self.notifier.send('%s - connect error' % profile_name, 'An unknown error occurred during authentication!', icon='auth_error', timeout=4000)
             self._temp_disabled_profile_names.remove(profile_name)
+            connect_failed = True
+
+        if connect_failed and self.exit_on_disconnect:
+            self.WakeUpIdle()
+            self.ExitMainLoop()
+
         self.taskbar.SetIconIdle()
 
     def OnSessionAuthenticate(self, evt):
diff --git a/pyhoca/wxgui/logon.py b/pyhoca/wxgui/logon.py
index 9ee6687..b53d977 100644
--- a/pyhoca/wxgui/logon.py
+++ b/pyhoca/wxgui/logon.py
@@ -200,6 +200,7 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
         """
         username = self.userTxt.GetValue()
         password = self.passwordTxt.GetValue()
+        connect_failed = False
         if self.sshproxy_auth:
             sshproxy_user = self.sshProxyUserTxt.GetValue()
             sshproxy_password = self.sshProxyPasswordTxt.GetValue()
@@ -279,6 +280,8 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
                                                  title=_(u'%s - connect failure') % self.current_profile_name, 
                                                  text=_(u'Authentication failed!'),
                                                  icon='auth_failed')
+                connect_failed = True
+
         except x2go.X2goSSHProxyAuthenticationException:
             wx.EndBusyCursor()
             self.sshProxyPasswordTxt.SetValue('')
@@ -299,12 +302,14 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
                                              title=_(u'%s - connect error') % self.current_profile_name, 
                                              text='%s!' % e.strerror,
                                              icon='auth_error')
+            connect_failed = True
 
         except gevent.socket.error, e:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name, 
                                              title=_(u'%s - connect error') % self.current_profile_name, 
                                              text='%s!' % e.strerror,
                                              icon='auth_error')
+            connect_failed = True
 
         except x2go.X2goHostKeyException, e:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name, 
@@ -312,20 +317,28 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
                                              text='%s!' % _(u'The remote server\'s host key is invalid or has not been accepted by the user'), 
                                              icon='auth_error', 
                                              timeout=4000)
+            connect_failed = True
 
         except x2go.X2goSSHProxyException, e:
             self._PyHocaGUI.notifier.prepare(_(u'%s - key error') % profile_name, '%s!' % str(e), icon='auth_error', timeout=4000)
+            connect_failed = True
 
         except:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name, 
                                              title=_(u'%s - connect error') % self.current_profile_name, 
                                              text=_(u'An unknown error occured during authentication!'),
                                              icon='auth_error')
+            connect_failed = True
 
         self._PyHocaGUI.notifier.send(self.current_profile_name, context='AUTH_%s' % self.current_profile_name, timeout=4000)
         self.Close()
         wx.SetCursor(wx.StockCursor(wx.CURSOR_ARROW))
         wx.EndBusyCursor()
+
+        if connect_failed and self._PyHocaGUI.exit_on_disconnect:
+            self._PyHocaGUI.WakeUpIdle()
+            self._PyHocaGUI.ExitMainLoop()
+
         if self._PyHocaGUI._X2goClient__is_session_connected(session_uuid):
             _dummy = self._PyHocaGUI.list_sessions(session_uuid, refresh_cache=True)
             self._PyHocaGUI._post_authenticate(evt, session_uuid)


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