[GRASS-SVN] r67465 - grass/branches/releasebranch_7_0/gui/wxpython/gmodeler
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jan 2 04:42:56 PST 2016
Author: martinl
Date: 2016-01-02 04:42:56 -0800 (Sat, 02 Jan 2016)
New Revision: 67465
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
Log:
wxGUI/modeler: check validity of input file when loading
(merge r67464 from trunk)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py 2016-01-02 12:39:53 UTC (rev 67464)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/model.py 2016-01-02 12:42:56 UTC (rev 67465)
@@ -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