瀏覽代碼

wxGUI: fix importing optional modules

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46055 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 年之前
父節點
當前提交
ee3ce84613
共有 3 個文件被更改,包括 8 次插入13 次删除
  1. 2 2
      gui/wxpython/gis_set_error.py
  2. 4 9
      gui/wxpython/gui_modules/layertree.py
  3. 2 2
      gui/wxpython/wxgui.py

+ 2 - 2
gui/wxpython/gis_set_error.py

@@ -3,7 +3,7 @@
 
 
 GRASS start-up screen error message.
 GRASS start-up screen error message.
 
 
-(C) 2010 by the GRASS Development Team
+(C) 2010-2011 by the GRASS Development Team
 
 
 This program is free software under the GNU General Public License
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -14,7 +14,7 @@ This program is free software under the GNU General Public License
 import os
 import os
 import sys
 import sys
 
 
-import gui_modules.globalvar as globalvar
+from gui_modules import globalvar
 import wx
 import wx
 
 
 def main():
 def main():

+ 4 - 9
gui/wxpython/gui_modules/layertree.py

@@ -30,6 +30,10 @@ except ImportError:
 import wx.combo
 import wx.combo
 import wx.lib.newevent
 import wx.lib.newevent
 import wx.lib.buttons  as  buttons
 import wx.lib.buttons  as  buttons
+try:
+    import treemixin 
+except ImportError:
+    from wx.lib.mixins import treemixin
 
 
 import globalvar
 import globalvar
 
 
@@ -48,15 +52,6 @@ from icon import Icons as Icons
 from preferences import globalSettings as UserSettings
 from preferences import globalSettings as UserSettings
 from vdigit import haveVDigit
 from vdigit import haveVDigit
 from gcmd import GWarning
 from gcmd import GWarning
-try:
-    import subprocess
-except:
-    from compat import subprocess
-    
-try:
-    import treemixin 
-except ImportError:
-    from wx.lib.mixins import treemixin
 
 
 TREE_ITEM_HEIGHT = 25
 TREE_ITEM_HEIGHT = 25
 
 

+ 2 - 2
gui/wxpython/wxgui.py

@@ -247,7 +247,7 @@ class GMFrame(wx.Frame):
     def OnGCPManager(self, event):
     def OnGCPManager(self, event):
         """!Launch georectifier module
         """!Launch georectifier module
         """
         """
-        import gui_modules.gcpmanager as gcpmanager
+        from gui_modules import gcpmanager
         gcpmanager.GCPWizard(self)
         gcpmanager.GCPWizard(self)
 
 
     def OnGModeler(self, event):
     def OnGModeler(self, event):
@@ -261,7 +261,7 @@ class GMFrame(wx.Frame):
         """!Launch Hardcopy Map Output Utility
         """!Launch Hardcopy Map Output Utility
         """
         """
         try:
         try:
-            import psmap
+            from gui_modules import psmap
         except:
         except:
             gcmd.GError(parent = self.parent,
             gcmd.GError(parent = self.parent,
                         message = _("Hardcopy Map Output Utility is not available. You can install it by %s") % \
                         message = _("Hardcopy Map Output Utility is not available. You can install it by %s") % \