[GRASS-SVN] r67993 - grass/trunk/lib/python/script
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 3 20:23:41 PST 2016
Author: wenzeslaus
Date: 2016-03-03 20:23:41 -0800 (Thu, 03 Mar 2016)
New Revision: 67993
Modified:
grass/trunk/lib/python/script/task.py
Log:
wxGUI: carry on the full path to executable for form.py if provided (#2133)
Modified: grass/trunk/lib/python/script/task.py
===================================================================
--- grass/trunk/lib/python/script/task.py 2016-03-03 21:20:01 UTC (rev 67992)
+++ grass/trunk/lib/python/script/task.py 2016-03-04 04:23:41 UTC (rev 67993)
@@ -509,6 +509,9 @@
def parse_interface(name, parser=processTask, blackList=None):
"""Parse interface of given GRASS module
+ The *name* is either GRASS module name (of a module on path) or
+ a full or relative path to an executable.
+
:param str name: name of GRASS module to be parsed
:param parser:
:param blackList:
@@ -518,7 +521,15 @@
except ETREE_EXCEPTIONS as error:
raise ScriptError(_("Cannot parse interface description of"
"<{name}> module: {error}").format(name=name, error=error))
- return parser(tree, blackList=blackList).get_task()
+ task = parser(tree, blackList=blackList).get_task()
+ # if name from interface is different than the originally
+ # provided name, then the provided name is likely a full path needed
+ # to actually run the module later
+ # (processTask uses only the XML which does not contain the original
+ # path used to execute the module)
+ if task.name != name:
+ task.path = name
+ return task
def command_info(cmd):
More information about the grass-commit
mailing list