[GRASS-SVN] r69359 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 3 10:05:42 PDT 2016


Author: wenzeslaus
Date: 2016-09-03 10:05:42 -0700 (Sat, 03 Sep 2016)
New Revision: 69359

Modified:
   grass/trunk/gui/wxpython/gui_core/ghelp.py
   grass/trunk/gui/wxpython/gui_core/goutput.py
   grass/trunk/gui/wxpython/gui_core/pyedit.py
   grass/trunk/gui/wxpython/gui_core/simplelmgr.py
   grass/trunk/gui/wxpython/gui_core/treeview.py
Log:
wxGUI: more code for testing individual components

Modified: grass/trunk/gui/wxpython/gui_core/ghelp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/ghelp.py	2016-09-03 15:48:33 UTC (rev 69358)
+++ grass/trunk/gui/wxpython/gui_core/ghelp.py	2016-09-03 17:05:42 UTC (rev 69359)
@@ -33,6 +33,11 @@
 
 import grass.script as grass
 
+# needed just for testing
+if __name__ == '__main__':
+    from grass.script.setup import set_gui_path
+    set_gui_path()
+
 from core import globalvar
 from core.utils import _
 from core.gcmd import GError, DecodeString
@@ -922,3 +927,17 @@
 
     return '%(c)s %(start)s-%(end)s by the GRASS Development Team' % {
         'c': unichr(169), 'start': start, 'end': end}
+
+
+def main():
+    """Test application (potentially useful as g.gui.gmanual)"""
+    app = wx.App()
+    frame = HelpFrame(parent=None, id=wx.ID_ANY,
+                      title="Test help application",
+                      size=(600, 800), file=sys.argv[1])
+    frame.Show()
+    app.MainLoop()
+
+
+if __name__ == '__main__':
+    main()

Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py	2016-09-03 15:48:33 UTC (rev 69358)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py	2016-09-03 17:05:42 UTC (rev 69359)
@@ -27,6 +27,11 @@
 
 from grass.pydispatch.signal import Signal
 
+# needed just for testing
+if __name__ == '__main__':
+    from grass.script.setup import set_gui_path
+    set_gui_path()
+
 from core.gcmd import GError, EncodeString
 from core.gconsole   import GConsole, \
     EVT_CMD_OUTPUT, EVT_CMD_PROGRESS, EVT_CMD_RUN, EVT_CMD_DONE, \

Modified: grass/trunk/gui/wxpython/gui_core/pyedit.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/pyedit.py	2016-09-03 15:48:33 UTC (rev 69358)
+++ grass/trunk/gui/wxpython/gui_core/pyedit.py	2016-09-03 17:05:42 UTC (rev 69359)
@@ -28,7 +28,6 @@
 
 from core.utils import _
 from core.gcmd import EncodeString, GError
-from core.giface import StandaloneGrassInterface
 from gui_core.pystc import PyStc
 from core import globalvar
 from core.menutree import MenuTreeModelBuilder
@@ -683,6 +682,8 @@
 
 def main():
     """Test application (potentially useful as g.gui.pyedit)"""
+    from core.giface import StandaloneGrassInterface
+
     app = wx.App()
     giface = StandaloneGrassInterface()
     simple_editor = PyEditFrame(parent=None, giface=giface)

Modified: grass/trunk/gui/wxpython/gui_core/simplelmgr.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2016-09-03 15:48:33 UTC (rev 69358)
+++ grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2016-09-03 17:05:42 UTC (rev 69359)
@@ -22,6 +22,11 @@
 
 from grass.pydispatch.signal import Signal
 
+# needed just for testing
+if __name__ == '__main__':
+    from grass.script.setup import set_gui_path
+    set_gui_path()
+
 from gui_core.toolbars import BaseToolbar, BaseIcons
 from icons.icon import MetaIcon
 from gui_core.forms import GUI
@@ -479,7 +484,8 @@
 class TestFrame(wx.Frame):
 
     def __init__(self, parent):
-        wx.Frame.__init__(self, parent=parent)
+        wx.Frame.__init__(self, parent=parent,
+                          title="Simple layer manager test")
         SimpleLayerManager(parent=self, layerList=LayerList())
 
 

Modified: grass/trunk/gui/wxpython/gui_core/treeview.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/treeview.py	2016-09-03 15:48:33 UTC (rev 69358)
+++ grass/trunk/gui/wxpython/gui_core/treeview.py	2016-09-03 17:05:42 UTC (rev 69359)
@@ -24,6 +24,11 @@
     import wx.lib.customtreectrl as CT
 import wx.gizmos as gizmos
 
+# needed just for testing
+if __name__ == '__main__':
+    from grass.script.setup import set_gui_path
+    set_gui_path()
+
 from core.globalvar import hasAgw
 from core.treemodel import TreeModel, DictNode
 from core.utils import _



More information about the grass-commit mailing list