瀏覽代碼

scipt:task import regexp module that it is used

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@65790 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 9 年之前
父節點
當前提交
f8bd0873ae
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      lib/python/script/task.py

+ 9 - 9
lib/python/script/task.py

@@ -17,7 +17,7 @@ for details.
 
 
 .. sectionauthor:: Martin Landa <landa.martin gmail.com>
 .. sectionauthor:: Martin Landa <landa.martin gmail.com>
 """
 """
-
+import re
 import types
 import types
 import string
 import string
 try:
 try:
@@ -595,29 +595,29 @@ def command_info(cmd):
 
 
 def cmdtuple_to_list(cmd):
 def cmdtuple_to_list(cmd):
     """Convert command tuple to list.
     """Convert command tuple to list.
-    
+
     :param tuple cmd: GRASS command to be converted
     :param tuple cmd: GRASS command to be converted
-    
+
     :return: command in list
     :return: command in list
     """
     """
     cmdList = []
     cmdList = []
     if not cmd:
     if not cmd:
         return cmdList
         return cmdList
-    
+
     cmdList.append(cmd[0])
     cmdList.append(cmd[0])
-    
+
     if 'flags' in cmd[1]:
     if 'flags' in cmd[1]:
         for flag in cmd[1]['flags']:
         for flag in cmd[1]['flags']:
             cmdList.append('-' + flag)
             cmdList.append('-' + flag)
     for flag in ('help', 'verbose', 'quiet', 'overwrite'):
     for flag in ('help', 'verbose', 'quiet', 'overwrite'):
         if flag in cmd[1] and cmd[1][flag] is True:
         if flag in cmd[1] and cmd[1][flag] is True:
             cmdList.append('--' + flag)
             cmdList.append('--' + flag)
-    
+
     for k, v in cmd[1].iteritems():
     for k, v in cmd[1].iteritems():
         if k in ('flags', 'help', 'verbose', 'quiet', 'overwrite'):
         if k in ('flags', 'help', 'verbose', 'quiet', 'overwrite'):
             continue
             continue
         cmdList.append('%s=%s' % (k, v))
         cmdList.append('%s=%s' % (k, v))
-            
+
     return cmdList
     return cmdList
 
 
 def cmdlist_to_tuple(cmd):
 def cmdlist_to_tuple(cmd):
@@ -629,7 +629,7 @@ def cmdlist_to_tuple(cmd):
     """
     """
     if len(cmd) < 1:
     if len(cmd) < 1:
         return None
         return None
-    
+
     dcmd = {}
     dcmd = {}
     for item in cmd[1:]:
     for item in cmd[1:]:
         if '=' in item: # params
         if '=' in item: # params
@@ -646,7 +646,7 @@ def cmdlist_to_tuple(cmd):
         else: # unnamed parameter
         else: # unnamed parameter
             module = parse_interface(cmd[0])
             module = parse_interface(cmd[0])
             dcmd[module.define_first()] = item
             dcmd[module.define_first()] = item
-    
+
     return (cmd[0], dcmd)
     return (cmd[0], dcmd)
 
 
 def cmdstring_to_tuple(cmd):
 def cmdstring_to_tuple(cmd):