Pārlūkot izejas kodu

wxGUI: fix importing optional modules

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46055 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 gadi atpakaļ
vecāks
revīzija
ee3ce84613

+ 2 - 2
gui/wxpython/gis_set_error.py

@@ -3,7 +3,7 @@
 
 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
 (>=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 sys
 
-import gui_modules.globalvar as globalvar
+from gui_modules import globalvar
 import wx
 
 def main():

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

@@ -30,6 +30,10 @@ except ImportError:
 import wx.combo
 import wx.lib.newevent
 import wx.lib.buttons  as  buttons
+try:
+    import treemixin 
+except ImportError:
+    from wx.lib.mixins import treemixin
 
 import globalvar
 
@@ -48,15 +52,6 @@ from icon import Icons as Icons
 from preferences import globalSettings as UserSettings
 from vdigit import haveVDigit
 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
 

+ 2 - 2
gui/wxpython/wxgui.py

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