소스 검색

pythonlib: clean tabs in script

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56840 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 년 전
부모
커밋
d5ac35c08a
4개의 변경된 파일23개의 추가작업 그리고 23개의 파일을 삭제
  1. 4 4
      lib/python/script/raster.py
  2. 6 6
      lib/python/script/raster3d.py
  3. 4 4
      lib/python/script/task.py
  4. 9 9
      lib/python/script/vector.py

+ 4 - 4
lib/python/script/raster.py

@@ -77,11 +77,11 @@ def raster_info(map):
     s = read_command('r.info', flags = 'gre', map = map)
     kv = parse_key_val(s)
     for k in ['min', 'max']:
-	kv[k] = float_or_null(kv[k])
+        kv[k] = float_or_null(kv[k])
     for k in ['north', 'south', 'east', 'west']:
-	kv[k] = float(kv[k])
+        kv[k] = float(kv[k])
     for k in ['nsres', 'ewres']:
-	kv[k] = float_or_dms(kv[k])
+        kv[k] = float_or_dms(kv[k])
     return kv
 
 # interface to r.mapcalc
@@ -102,7 +102,7 @@ def mapcalc(exp, quiet = False, verbose = False, overwrite = False, **kwargs):
                    quiet = quiet,
                    verbose = verbose,
                    overwrite = overwrite) != 0:
-	fatal(_("An error occurred while running r.mapcalc"))
+        fatal(_("An error occurred while running r.mapcalc"))
 
 
 def mapcalc_start(exp, quiet = False, verbose = False, overwrite = False, **kwargs):

+ 6 - 6
lib/python/script/raster3d.py

@@ -57,15 +57,15 @@ def raster3d_info(map):
     s = read_command('r3.info', flags='rg', map=map)
     kv = parse_key_val(s)
     for k in ['min', 'max']:
-	kv[k] = float_or_null(kv[k])
+        kv[k] = float_or_null(kv[k])
     for k in ['north', 'south', 'east', 'west', 'top', 'bottom']:
-	kv[k] = float(kv[k])
+        kv[k] = float(kv[k])
     for k in ['nsres', 'ewres', 'tbres']:
-	kv[k] = float_or_dms(kv[k])
+        kv[k] = float_or_dms(kv[k])
     for k in ['tilenumx', 'tilenumy', 'tilenumz']:
-	kv[k] = int(kv[k])
+        kv[k] = int(kv[k])
     for k in ['tiledimx', 'tiledimy', 'tiledimz']:
-	kv[k] = int(kv[k])
+        kv[k] = int(kv[k])
     return kv
 
 # interface to r3.mapcalc
@@ -86,4 +86,4 @@ def mapcalc3d(exp, quiet = False, verbose = False, overwrite = False, **kwargs):
                    quiet = quiet,
                    verbose = verbose,
                    overwrite = overwrite) != 0:
-	fatal(_("An error occurred while running r3.mapcalc"))
+        fatal(_("An error occurred while running r3.mapcalc"))

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

@@ -442,8 +442,8 @@ def get_interface_description(cmd):
     @param cmd command (name of GRASS module)
     """
     try:
-	p = Popen([cmd, '--interface-description'], stdout = PIPE,
-						    stderr = PIPE)
+        p = Popen([cmd, '--interface-description'], stdout = PIPE,
+                  stderr = PIPE)
         cmdout, cmderr = p.communicate()
         
         # TODO: replace ugly hack bellow
@@ -452,8 +452,8 @@ def get_interface_description(cmd):
                 cmd += '.py'
             
             os.chdir(os.path.join(os.getenv('GISBASE'), 'scripts'))
-	    p = Popen([sys.executable, cmd, '--interface-description'],
-		      stdout = PIPE, stderr = PIPE)
+            p = Popen([sys.executable, cmd, '--interface-description'],
+                      stdout = PIPE, stderr = PIPE)
             cmdout, cmderr = p.communicate()
         
         if p.returncode != 0:

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

@@ -51,9 +51,9 @@ def vector_db(map, **args):
     result = {}
     
     for l in s.splitlines():
-	f = l.split(';')
-	if len(f) != 5:
-	    continue
+        f = l.split(';')
+        if len(f) != 5:
+            continue
         
         if '/' in f[0]:
             f1 = f[0].split('/')
@@ -63,7 +63,7 @@ def vector_db(map, **args):
             layer = f[0]
             name = ''
             
-	result[int(layer)] = {
+        result[int(layer)] = {
             'layer'    : int(layer),
             'name'     : name,
             'table'    : f[1],
@@ -85,7 +85,7 @@ def vector_layer_db(map, layer):
     try:
         f = vector_db(map)[int(layer)]
     except KeyError:
-	fatal(_("Database connection not defined for layer %s") % layer)
+        fatal(_("Database connection not defined for layer %s") % layer)
 
     return f
 
@@ -118,7 +118,7 @@ def vector_columns(map, layer = None, getDict = True, **args):
         result = list()
     i = 0
     for line in s.splitlines():
-	ctype, cname = line.split('|')
+        ctype, cname = line.split('|')
         if getDict:
             result[cname] = { 'type' : ctype,
                               'index' : i }
@@ -195,11 +195,11 @@ def vector_info(map):
     
     kv = parse_key_val(s)
     for k in ['north', 'south', 'east', 'west', 'top', 'bottom']:
-	kv[k] = float(kv[k])
+        kv[k] = float(kv[k])
     for k in ['level', 'num_dblinks']:
-	kv[k] = int(kv[k])
+        kv[k] = int(kv[k])
     for k in ['nodes', 'points', 'lines', 'boundaries', 'centroids', 'areas', 'islands', 'primitives']:
-	kv[k] = int(kv[k])
+        kv[k] = int(kv[k])
     if 'map3d' in kv:
         kv['map3d'] = bool(int(kv['map3d']))
         if kv['map3d']: