[X2go-Commits] pyhoca-gui.git - build-main (branch) updated: 0.1.0.3

X2go dev team git-admin at x2go.org
Thu Jun 23 00:47:13 CEST 2011


The branch, build-main has been updated
       via  58942df85e7133cbf39e359a2efc821d7be17ae3 (commit)
       via  6776dbfb62c89009be269ee96b7544b01202f4ca (commit)
       via  a47515c812d9cce9d61602d0eed4d070c4554703 (commit)
       via  c53d704bed4c24773ebd4b04e765e86f69539396 (commit)
       via  dd455a3b4eda3bffb0008e68fc5876798ceb3990 (commit)
       via  82b4fe8750c58ac81d04a4d9772809243a266236 (commit)
       via  da63975592fcce5adf1f3e4420862b5b039d13d6 (commit)
       via  51ec74b6782193e13b5b5d646d211328c1d7fa4f (commit)
       via  2c7ce58ee48411235359846f85b93d1087b823e5 (commit)
       via  43f3d53d46687eed835a3202eda482738cfe1659 (commit)
       via  c8bb328e8db95a7e9056f92909681c3ae62492bf (commit)
       via  d215d5a8532a28e053607f2d587e949d685342a1 (commit)
       via  b4d8418982b78220c40ffd6e9231fd037d47a516 (commit)
       via  f77b4cb44d12122ad3d455b4baa106c285be5127 (commit)
       via  b344d95c5629d51f7ec31cfed76e071782afe8f7 (commit)
       via  9575809204dd7d58d174ce9c3d286fe55b5fe004 (commit)
       via  c8f2ebd5b8455a4ca953cd368bd515b6bcb9ac95 (commit)
      from  cf20bd0e4f17055d90aa7cf2c88c06f6344d95f2 (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:
 debian/changelog         |   11 +++++++++++
 debian/control           |    2 +-
 pyhoca/wxgui/__init__.py |    2 +-
 pyhoca/wxgui/frontend.py |   26 ++++++++++++++++----------
 pyhoca/wxgui/logon.py    |   23 ++++++++++++++---------
 pyhoca/wxgui/notify.py   |    6 ++++--
 6 files changed, 47 insertions(+), 23 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 132c17a..e7568a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+pyhoca-gui (0.1.0.3-0~x2go1) unstable; urgency=low
+
+  New upstream version (0.1.0.3):
+    - Fix utf-8 errors during authentication.
+    - Release session name on connection errors when greyed out.
+    - Spawn initial list sessions call into background to unblock I/O
+      during/after authentication.
+  * Depend on Python X2go 0.1.1.0.
+
+ -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 23 Jun 2011 00:45:34 +0200
+
 pyhoca-gui (0.1.0.2-0~x2go1) unstable; urgency=low
 
   * New upstream release (0.1.0.2):
diff --git a/debian/control b/debian/control
index 72491fe..e17abed 100644
--- a/debian/control
+++ b/debian/control
@@ -27,7 +27,7 @@ Architecture: all
 Depends: 
  ${misc:Depends},
  python,
- python-x2go (>=0.1.0.3-0~0),
+ python-x2go (>=0.1.1.0-0~0),
  python-argparse,
  python-notify,
  python-setproctitle,
diff --git a/pyhoca/wxgui/__init__.py b/pyhoca/wxgui/__init__.py
index 8cf68a8..3871e00 100644
--- a/pyhoca/wxgui/__init__.py
+++ b/pyhoca/wxgui/__init__.py
@@ -18,6 +18,6 @@
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-__VERSION__ = '0.1.0.2'
+__VERSION__ = '0.1.0.3'
 
 from frontend import *
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index f33d494..7fa0d22 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -318,6 +318,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
     def _post_authenticate(self, evt, session_uuid):
 
         _resumed = False
+        _dummy = self.list_sessions(session_uuid, refresh_cache=True)
         if self.resume_newest_on_connect:
             _resumed = self._resume_newest_on_connect(evt, session_uuid)
         elif self.resume_oldest_on_connect:
@@ -356,35 +357,35 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
             _logon_window = logon.PyHocaGUI_DialogBoxPassword(self, profile_name, caller=self, sshproxy_auth=True )
             self._logon_windows[profile_name] = _logon_window
         except x2go.SSHException, e:
-            self.notifier.send(_(u'%s - connect error') % profile_name, '%s!' % str(e), icon='auth_error', timeout=4000)
+            self.notifier.send(_(u'%s - connect error') % profile_name, u'%s!' % str(e), icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
                 pass
             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.notifier.send(_(u'%s - host key error') % profile_name, _(u'The remote server\'s host key is invalid or has not been accepted by the user') + '!', icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
                 pass
             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.notifier.send(_(u'%s - host key error') % profile_name, _(u'The SSH proxy\'s host key is invalid or has not been accepted by the user') + '!', icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
                 pass
             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.notifier.send(_(u'%s - connect error') % profile_name, e.strerror, icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
                 pass
             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.notifier.send(_(u'%s - connect error') % profile_name, e.strerror, icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
@@ -398,14 +399,14 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
                 pass
             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.notifier.send(_(u'%s - auth key error') % profile_name, u'%s' % str(e), icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
                 pass
             connect_failed = True
         except:
-            self.notifier.send('%s - connect error' % profile_name, 'An unknown error occurred during authentication!', icon='auth_error', timeout=4000)
+            self.notifier.send('%s - connect error' % profile_name, _(u'An unknown error occurred during authentication!'), icon='auth_error', timeout=4000)
             try:
                 self._temp_disabled_profile_names.remove(profile_name)
             except ValueError:
@@ -526,8 +527,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
         # disconnect all profile sessions
         if self._X2goClient__server_is_alive(session_uuid):
             self._X2goClient__disconnect_profile(self.current_profile_name)
-            if not self._X2goClient__is_session_connected(session_uuid):
-                self.notifier.send(_(u'%s - disconnect') % self.current_profile_name, _(u'X2go Profile is now disconnected.'), icon='auth_disconnect', timeout=4000)
+            self.notifier.send(_(u'%s - disconnect') % self.current_profile_name, _(u'X2go Profile is now disconnected.'), icon='auth_disconnect', timeout=4000)
         if self.exit_on_disconnect:
             self._pyhoca_logger('Exiting %s because %s got disconnected.' % (self.appname, self.current_profile_name), loglevel=x2go.loglevel_NOTICE)
             self.WakeUpIdle()
@@ -672,7 +672,7 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
     def HOOK_on_control_session_death(self, profile_name):
         self.notifier.send(_(u'%s - channel error') % profile_name, _(u'Lost connection to server %s unexpectedly! Try to re-authenticate to the server...') % profile_name, icon='session_warning', timeout=10000)
         try:
-            del self._temp_disabled_session_names[self.current_profile_name]
+            del self._temp_disabled_session_names[profile_name]
         except KeyError:
             pass
         if self.exit_on_disconnect:
@@ -693,6 +693,12 @@ class PyHocaGUI(wx.App, x2go.X2goClient):
 
     def HOOK_forwarding_tunnel_setup_failed(self, profile_name='UNKNOWN', session_name='UNKNOWN', chain_host='UNKNOWN', chain_port=0):
         self.notifier.send(_(u'%s - session failure') % profile_name, _(u'Forwarding tunnel request to [%s]:%s for session %s was denied by remote X2go/SSH server. Session startup failed.') % (chain_host, chain_port, session_name), icon='session_error', timeout=10000)
+        try:
+            self._temp_disabled_session_names[profile_name].remove(session_name)
+        except KeyError:
+            pass
+        except ValueError:
+            pass
         if self.exit_on_disconnect:
             self.WakeUpIdle()
             self.ExitMainLoop()
diff --git a/pyhoca/wxgui/logon.py b/pyhoca/wxgui/logon.py
index cd2dfb0..7010d6f 100644
--- a/pyhoca/wxgui/logon.py
+++ b/pyhoca/wxgui/logon.py
@@ -79,8 +79,11 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
 
         if self.sshproxy_auth:
             self.sshproxy_started = False
+            self.sshproxy_password = None
             self.SetTitle(_(u'%s (via %s)') % (profile_name, self.current_profile_config['sshproxyhost']))
 
+        self.password = None
+
         self.userLbl = wx.StaticText(self, wx.ID_ANY, _(u'Username')+':', size=(-1, -1)) 
         self.userTxt = wx.TextCtrl(self, wx.ID_ANY, '', style=wx.TE_PROCESS_ENTER, size=(120, -1)) 
         self.passwordLbl = wx.StaticText(self, wx.ID_ANY, _(u'Password')+':', size=(-1, -1)) 
@@ -302,27 +305,27 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
         except gevent.dns.DNSError, e:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name, 
                                              title=_(u'%s - connect error') % self.current_profile_name, 
-                                             text='%s!' % e.strerror,
+                                             text=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,
+                                             text=e.strerror + '!',
                                              icon='auth_error')
             connect_failed = True
 
         except x2go.X2goHostKeyException, e:
             self._PyHocaGUI.notifier.prepare('AUTH_%s' % self.current_profile_name, 
                                              title=_(u'%s - host key error') % self.current_profile_name, 
-                                             text='%s!' % _(u'The remote server\'s host key is invalid or has not been accepted by the user'), 
+                                             text=_(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)
+            self._PyHocaGUI.notifier.prepare(_(u'%s - key error') % profile_name, '%s!' % decode(str(e)), icon='auth_error', timeout=4000)
             connect_failed = True
 
         except:
@@ -335,23 +338,25 @@ class PyHocaGUI_DialogBoxPassword(wx.Frame):
                 raise
 
         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()
+        # Windows's GUI is more picky then Linux's GTK GUI about EndBusyCursor if cursor is not busy...
+        try: wx.EndBusyCursor()
+        except: pass
 
         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)
+            gevent.spawn(self._PyHocaGUI._post_authenticate, evt, session_uuid)
         self.sshproxy_started = False
         del self._PyHocaGUI._logon_windows[self.current_profile_name]
+
+        self.Close()
         self.Destroy()
 
     def OnCancel(self, evt):
-        self.Destroy()
+        self.Close()
 
     def Destroy(self):
         try:
diff --git a/pyhoca/wxgui/notify.py b/pyhoca/wxgui/notify.py
index 3d2235d..b0a2160 100644
--- a/pyhoca/wxgui/notify.py
+++ b/pyhoca/wxgui/notify.py
@@ -27,6 +27,8 @@ if X2GOCLIENT_OS in ('Linux', 'Mac'):
 import exceptions
 import basepath
 
+import x2go.utils as utils
+
 _icons_location = basepath.icons_basepath
 
 class NotSupportedException(exceptions.StandardError): pass
@@ -85,7 +87,7 @@ class libnotify_NotifierPopup(object):
         n.set_urgency(pynotify.URGENCY_NORMAL)
         n.set_timeout(timeout)
 
-        self._pyhoca_logger('[%s] %s' % (title, text), loglevel=log.loglevel_NOTICE)
+        self._pyhoca_logger('[%s] %s' % (title.encode(utils.get_encoding()), text.encode(utils.get_encoding())), loglevel=log.loglevel_NOTICE)
         if not n.show():
             raise PyHocaNotificationException('could not notify user')
 
@@ -171,7 +173,7 @@ class notificationmessage_NotifierPopup(object):
             # wx.NotificationMessage class
             pass
 
-        self._pyhoca_logger('[%s] %s' % (title, text), loglevel=log.loglevel_NOTICE)
+        self._pyhoca_logger('[%s] %s' % (title.encode(utils.get_encoding()), text.encode(utils.get_encoding())), loglevel=log.loglevel_NOTICE)
 
     def Close(self):
         pass


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