[GRASS-SVN] r56840 - grass/trunk/lib/python/script

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jun 20 08:02:58 PDT 2013


Author: annakrat
Date: 2013-06-20 08:02:57 -0700 (Thu, 20 Jun 2013)
New Revision: 56840

Modified:
   grass/trunk/lib/python/script/raster.py
   grass/trunk/lib/python/script/raster3d.py
   grass/trunk/lib/python/script/task.py
   grass/trunk/lib/python/script/vector.py
Log:
pythonlib: clean tabs in script

Modified: grass/trunk/lib/python/script/raster.py
===================================================================
--- grass/trunk/lib/python/script/raster.py	2013-06-20 15:02:05 UTC (rev 56839)
+++ grass/trunk/lib/python/script/raster.py	2013-06-20 15:02:57 UTC (rev 56840)
@@ -77,11 +77,11 @@
     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 @@
                    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):

Modified: grass/trunk/lib/python/script/raster3d.py
===================================================================
--- grass/trunk/lib/python/script/raster3d.py	2013-06-20 15:02:05 UTC (rev 56839)
+++ grass/trunk/lib/python/script/raster3d.py	2013-06-20 15:02:57 UTC (rev 56840)
@@ -57,15 +57,15 @@
     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 @@
                    quiet = quiet,
                    verbose = verbose,
                    overwrite = overwrite) != 0:
-	fatal(_("An error occurred while running r3.mapcalc"))
+        fatal(_("An error occurred while running r3.mapcalc"))

Modified: grass/trunk/lib/python/script/task.py
===================================================================
--- grass/trunk/lib/python/script/task.py	2013-06-20 15:02:05 UTC (rev 56839)
+++ grass/trunk/lib/python/script/task.py	2013-06-20 15:02:57 UTC (rev 56840)
@@ -442,8 +442,8 @@
     @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 @@
                 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:

Modified: grass/trunk/lib/python/script/vector.py
===================================================================
--- grass/trunk/lib/python/script/vector.py	2013-06-20 15:02:05 UTC (rev 56839)
+++ grass/trunk/lib/python/script/vector.py	2013-06-20 15:02:57 UTC (rev 56840)
@@ -51,9 +51,9 @@
     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 @@
             layer = f[0]
             name = ''
             
-	result[int(layer)] = {
+        result[int(layer)] = {
             'layer'    : int(layer),
             'name'     : name,
             'table'    : f[1],
@@ -85,7 +85,7 @@
     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 @@
         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 @@
     
     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']:



More information about the grass-commit mailing list