[X2Go-Commits] [pyhoca-gui] 03/04: formalistic code cleanup using pyflakes

git-admin at x2go.org git-admin at x2go.org
Mon Oct 20 11:12:16 CEST 2014


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository pyhoca-gui.

commit 9d57084a587a920bc987c932a46280a9783b02ce
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Oct 20 11:10:52 2014 +0200

    formalistic code cleanup using pyflakes
---
 pyhoca-gui                     |    3 ---
 pyhoca/wxgui/brokerlogon.py    |    3 ---
 pyhoca/wxgui/frontend.py       |    2 +-
 pyhoca/wxgui/launcher.py       |    4 ----
 pyhoca/wxgui/listdesktops.py   |    3 ---
 pyhoca/wxgui/menus_taskbar.py  |    3 +--
 pyhoca/wxgui/notify.py         |    1 -
 pyhoca/wxgui/profilemanager.py |    1 -
 pyhoca/wxgui/serverinfo.py     |    3 ---
 pyhoca/wxgui/sessiontitle.py   |    3 ---
 pyhoca/wxgui/taskbar.py        |    6 ------
 setup.py                       |   18 ++++++++++++------
 12 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/pyhoca-gui b/pyhoca-gui
index f1d2c0c..6761d3b 100755
--- a/pyhoca-gui
+++ b/pyhoca-gui
@@ -19,9 +19,6 @@
 # Free Software Foundation, Inc.,
 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-import os
-import sys
-
 try:
     import wxversion
     wxversion.select(['3.0', '2.9', '2.8'])
diff --git a/pyhoca/wxgui/brokerlogon.py b/pyhoca/wxgui/brokerlogon.py
index 6e59995..af581db 100644
--- a/pyhoca/wxgui/brokerlogon.py
+++ b/pyhoca/wxgui/brokerlogon.py
@@ -23,9 +23,6 @@ modules ={}
 # Python X2Go
 import x2go
 
-# gevent
-import gevent
-
 import wx
 import os
 
diff --git a/pyhoca/wxgui/frontend.py b/pyhoca/wxgui/frontend.py
index c59c1c3..da8afba 100644
--- a/pyhoca/wxgui/frontend.py
+++ b/pyhoca/wxgui/frontend.py
@@ -832,7 +832,7 @@ class PyHocaGUI(wx.App, x2go.X2GoClient):
         @type evt: C{obj}
 
         """
-        _broker_logon_window = brokerlogon.PyHocaGUI_BrokerDialogBoxPassword(self, caller=self)
+        brokerlogon.PyHocaGUI_BrokerDialogBoxPassword(self, caller=self)
 
     def OnBrokerDisconnect(self, evt):
         """\
diff --git a/pyhoca/wxgui/launcher.py b/pyhoca/wxgui/launcher.py
index 152d239..03d3384 100644
--- a/pyhoca/wxgui/launcher.py
+++ b/pyhoca/wxgui/launcher.py
@@ -22,7 +22,6 @@ modules ={}
 
 import sys
 import os
-import re
 import shutil
 import argparse
 import gettext
@@ -47,7 +46,6 @@ from messages import PyHoca_MessageWindow_Ok
 
 import defaults
 import basepath
-import taskbar
 
 
 class PyHocaGUI_Launcher(object):
@@ -126,7 +124,6 @@ VERSION: %s
             my_display = os.environ['DISPLAY']
             open(my_pidfile, 'w').write(my_display)
 
-            already_running_for_this_display = False
             for pidfile in os.listdir(os.path.expanduser("~/.x2go/{progname}/".format(progname=_executable))):
 
                 # this is our own pid file...
@@ -300,7 +297,6 @@ VERSION: %s
         else:
             _option_groups = ((p_guiopts, x2go_gui_options), (p_brokeropts, broker_options), (p_debugopts, debug_options),  (p_portableopts, portable_options), (p_backendopts, backend_options), )
         for (p_group, opts) in _option_groups:
-            required = False
             for opt in opts:
 
                 args = opt['args']
diff --git a/pyhoca/wxgui/listdesktops.py b/pyhoca/wxgui/listdesktops.py
index d6010cf..8910430 100644
--- a/pyhoca/wxgui/listdesktops.py
+++ b/pyhoca/wxgui/listdesktops.py
@@ -23,9 +23,6 @@ modules ={}
 # Python X2Go
 import x2go
 
-# gevent
-import gevent
-
 import wx
 import os
 
diff --git a/pyhoca/wxgui/menus_taskbar.py b/pyhoca/wxgui/menus_taskbar.py
index 45a68f0..4173573 100644
--- a/pyhoca/wxgui/menus_taskbar.py
+++ b/pyhoca/wxgui/menus_taskbar.py
@@ -20,7 +20,6 @@
 
 import os.path
 import wx
-import re
 import StringIO
 import base64
 
@@ -576,7 +575,7 @@ class PyHocaGUI_Menu_TaskbarSessionProfile(wx.Menu):
                     self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnSessionStart, id=ID_SESSIONSTART)
 
                 elif _command == 'SHADOW':
-                    start_shadow_session = self.Append(id=ID_SHADOWSESSIONSTART, text=_(u"Start Desktop Sharing Session"))
+                    self.Append(id=ID_SHADOWSESSIONSTART, text=_(u"Start Desktop Sharing Session"))
                     self._PyHocaGUI.Bind(wx.EVT_MENU, self._PyHocaGUI.OnShadowSessionStart, id=ID_SHADOWSESSIONSTART)
 
                 elif _command == '' and _published:
diff --git a/pyhoca/wxgui/notify.py b/pyhoca/wxgui/notify.py
index db1ceba..29e6eaf 100644
--- a/pyhoca/wxgui/notify.py
+++ b/pyhoca/wxgui/notify.py
@@ -25,7 +25,6 @@ if X2GOCLIENT_OS in ('Linux', 'Mac'):
     import pynotify
 import exceptions
 import basepath
-from taskbar import MakeIcon
 
 import x2go.utils as utils
 
diff --git a/pyhoca/wxgui/profilemanager.py b/pyhoca/wxgui/profilemanager.py
index 1aae3d2..ab10724 100644
--- a/pyhoca/wxgui/profilemanager.py
+++ b/pyhoca/wxgui/profilemanager.py
@@ -22,7 +22,6 @@ import wx
 import os
 import copy
 import types
-import re
 
 import x2go.log as log
 import x2go.utils as utils
diff --git a/pyhoca/wxgui/serverinfo.py b/pyhoca/wxgui/serverinfo.py
index 6e5bdd8..4466f00 100644
--- a/pyhoca/wxgui/serverinfo.py
+++ b/pyhoca/wxgui/serverinfo.py
@@ -23,9 +23,6 @@ modules ={}
 # Python X2Go
 import x2go
 
-# gevent
-import gevent
-
 import wx
 import os
 
diff --git a/pyhoca/wxgui/sessiontitle.py b/pyhoca/wxgui/sessiontitle.py
index 14edff8..a6ec438 100644
--- a/pyhoca/wxgui/sessiontitle.py
+++ b/pyhoca/wxgui/sessiontitle.py
@@ -23,9 +23,6 @@ modules ={}
 # Python X2Go
 import x2go
 
-# gevent
-import gevent
-
 import wx
 import os
 
diff --git a/pyhoca/wxgui/taskbar.py b/pyhoca/wxgui/taskbar.py
index e8847cf..4dfb0ae 100644
--- a/pyhoca/wxgui/taskbar.py
+++ b/pyhoca/wxgui/taskbar.py
@@ -23,13 +23,7 @@ modules ={}
 # Python X2Go
 import x2go
 
-import gevent
-
 import wx
-
-if x2go.X2GOCLIENT_OS == 'Windows':
-    import win32gui
-
 import os
 
 # PyHoca-GUI modules
diff --git a/setup.py b/setup.py
index c115f56..8e12901 100755
--- a/setup.py
+++ b/setup.py
@@ -29,10 +29,14 @@ UNINSTALL_NAME = 'PyHoca-GUI (A graphical X2Go client)'
 SCRIPT_NAME = 'pyhoca-gui'
 PROGRAM_DESC = '%s is a cross-platform (Windows, MacOS X, Linux) graphical X2Go client.' % PROGRAM_NAME
 PROGRAM_DESC_SHORT = '%s is a graphical X2Go client.' % PROGRAM_NAME
+
+# silence pyflakes with assigning a dummy version here... the real __VERSION__ assignment happens below
+__VERSION__ = '0.0.0.0'
 for line in file(os.path.join('pyhoca', 'wxgui', '__init__.py')).readlines():
     if (line.startswith('__VERSION__')):
         exec(line.strip())
 PROGRAM_VERSION = __VERSION__
+
 PROGRAM_ICON = "pixmaps/pyhoca_x2go-logo-ubuntu.ico"
 # Windows:  UNINSTALL_ICON is for add/remove programs.
 UNINSTALL_ICON = "icons\\pyhoca-gui.ico"
@@ -46,8 +50,8 @@ if platform.system() == 'Windows':
     REGULAR_NSIS = os.path.join(os.environ['ProgramFiles'], 'NSIS', 'makensis.exe')
     UNICODE_NSIS = os.path.join(os.environ['ProgramFiles'], 'NSIS','Unicode', 'makensis.exe')
 
-from setuptools import setup, find_packages
-from distutils.core import setup, Command
+from setuptools import setup
+from distutils.core import Command
 
 base = None
 executables = []
@@ -76,7 +80,9 @@ if platform.system() == 'Windows':
     sys.path.append(os.path.normpath('../pyhoca-contrib/mswin/ms-vc-runtime'))
 
 elif platform.system() == 'Linux':
-    from DistUtilsExtra.command import *
+    import DistUtilsExtra.command.build_extra
+    import DistUtilsExtra.command.build_i18n
+    import DistUtilsExtra.command.clean_i18n
     py2exe = object
     Freezer = object
 
@@ -289,9 +295,9 @@ if platform.system() == 'Windows':
 elif platform.system() == 'Linux':
     cmd_class.update(
         {
-            "build" : build_extra.build_extra,
-            "build_i18n" :  build_i18n.build_i18n,
-            "clean": clean_i18n.clean_i18n,
+            "build" : DistUtilsExtra.command.build_extra.build_extra,
+            "build_i18n" :  DistUtilsExtra.command.build_i18n.build_i18n,
+            "clean": DistUtilsExtra.command.clean_i18n.clean_i18n,
         }
     )
 

--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/pyhoca-gui.git


More information about the x2go-commits mailing list