[GRASS-SVN] r64674 - grass/trunk/gui/wxpython/tplot

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 17 15:08:31 PST 2015


Author: wenzeslaus
Date: 2015-02-17 15:08:30 -0800 (Tue, 17 Feb 2015)
New Revision: 64674

Modified:
   grass/trunk/gui/wxpython/tplot/g.gui.tplot.py
Log:
wxGUI: import only after grass.script.parser() call in g.gui.* modules (tplot forgotten in r64664, #1819)

Modified: grass/trunk/gui/wxpython/tplot/g.gui.tplot.py
===================================================================
--- grass/trunk/gui/wxpython/tplot/g.gui.tplot.py	2015-02-17 22:46:26 UTC (rev 64673)
+++ grass/trunk/gui/wxpython/tplot/g.gui.tplot.py	2015-02-17 23:08:30 UTC (rev 64674)
@@ -45,17 +45,18 @@
 #% required: no
 #%end
 
-import  wx
+import grass.script as gscript
 
-import grass.script as grass
-from core.utils import GuiModuleMain
 
+def main():
+    options, flags = gscript.parser()
 
-def main():
+    import wx
+    from core.utils import _
     try:
         from tplot.frame import TplotFrame
     except ImportError as e:
-        grass.fatal(e.message)
+        gscript.fatal(e.message)
 
     datasets = options['inputs'].strip().split(',')
     datasets = [data for data in datasets if data]
@@ -64,7 +65,8 @@
     dpi = options['dpi']
     dpi = int(dpi) if dpi else None
     if dpi and not output:
-        grass.warning(_("No output filename set, so DPI option will not used"))
+        gscript.warning(
+            _("No output filename set, so DPI option will not used"))
 
     app = wx.App()
     frame = TplotFrame(None)
@@ -77,6 +79,4 @@
 
 
 if __name__ == '__main__':
-    options, flags = grass.parser()
-
-    GuiModuleMain(main)
+    main()



More information about the grass-commit mailing list