[GRASS-SVN] r67464 - grass/trunk/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 2 04:39:53 PST 2016


Author: martinl
Date: 2016-01-02 04:39:53 -0800 (Sat, 02 Jan 2016)
New Revision: 67464

Modified:
   grass/trunk/gui/wxpython/gmodeler/model.py
Log:
wxGUI/modeler: check validity of input file when loading

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2016-01-01 12:25:24 UTC (rev 67463)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2016-01-02 12:39:53 UTC (rev 67464)
@@ -1741,6 +1741,13 @@
         """
         self.tree = tree
         self.root = self.tree.getroot()
+        # check if input is a valid GXM file
+        if self.root is None or self.root.tag != 'gxm':
+            if self.root is not None:
+                tagName = self.root.tag
+            else:
+                tabName = _("empty")
+            raise GException(_("Details: unsupported tag name '{}'.").format(tagName))
         
         # list of actions, data
         self.properties = dict()



More information about the grass-commit mailing list