소스 검색

wxGUI: carry on the full path to executable for form.py if provided (https://trac.osgeo.org/grass/ticket/2133)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67993 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 9 년 전
부모
커밋
98e0737904
1개의 변경된 파일12개의 추가작업 그리고 1개의 파일을 삭제
  1. 12 1
      lib/python/script/task.py

+ 12 - 1
lib/python/script/task.py

@@ -509,6 +509,9 @@ def get_interface_description(cmd):
 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 @@ def parse_interface(name, parser=processTask, blackList=None):
     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):