[GRASS-SVN] r59387 - in grass/trunk/lib/python: pygrass/gis pygrass/modules/interface script

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 26 16:13:57 PDT 2014


Author: hamish
Date: 2014-03-26 16:13:57 -0700 (Wed, 26 Mar 2014)
New Revision: 59387

Modified:
   grass/trunk/lib/python/pygrass/gis/region.py
   grass/trunk/lib/python/pygrass/modules/interface/module.py
   grass/trunk/lib/python/script/core.py
Log:
only read region, don't alter WIND file (#2230)

Modified: grass/trunk/lib/python/pygrass/gis/region.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/region.py	2014-03-26 23:06:30 UTC (rev 59386)
+++ grass/trunk/lib/python/pygrass/gis/region.py	2014-03-26 23:13:57 UTC (rev 59387)
@@ -204,7 +204,7 @@
                          border='1', kdec='b')
 
     def __unicode__(self):
-        return grass.pipe_command("g.region", flags="p").communicate()[0]
+        return grass.pipe_command("g.region", flags="pu").communicate()[0]
 
     def __str__(self):
         return self.__unicode__()

Modified: grass/trunk/lib/python/pygrass/modules/interface/module.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-03-26 23:06:30 UTC (rev 59386)
+++ grass/trunk/lib/python/pygrass/modules/interface/module.py	2014-03-26 23:13:57 UTC (rev 59387)
@@ -10,9 +10,10 @@
 >>> import copy
 >>> region = pymod.Module("g.region")
 >>> region.flags["p"].value = True
+>>> region.flags["u"].value = True
 >>> region.flags["3"].value = True
 >>> region.get_bash()
-'g.region -p -3'
+'g.region -p -u -3'
 >>> new_region = copy.deepcopy(region)
 >>> new_region.inputs["res"].value = "10"
 >>> new_region.get_bash()

Modified: grass/trunk/lib/python/script/core.py
===================================================================
--- grass/trunk/lib/python/script/core.py	2014-03-26 23:06:30 UTC (rev 59386)
+++ grass/trunk/lib/python/script/core.py	2014-03-26 23:13:57 UTC (rev 59387)
@@ -978,11 +978,11 @@
 
 def locn_is_latlong():
     """!Tests if location is lat/long. Value is obtained
-    by checking the "g.region -p" projection code.
+    by checking the "g.region -pu" projection code.
 
     @return True for a lat/long region, False otherwise
     """
-    s = read_command("g.region", flags='p')
+    s = read_command("g.region", flags='pu')
     kv = parse_key_val(s, ':')
     if kv['projection'].split(' ')[0] == '3':
         return True
@@ -991,7 +991,7 @@
 
 
 def region(region3d=False, complete=False):
-    """!Returns the output from running "g.region -g", as a
+    """!Returns the output from running "g.region -gu", as a
     dictionary. Example:
 
     @param region3d True to get 3D region
@@ -1009,7 +1009,7 @@
 
     @return dictionary of region values
     """
-    flgs = 'g'
+    flgs = 'gu'
     if region3d:
         flgs += '3'
     if complete:
@@ -1067,7 +1067,7 @@
     if not kwargs:  # return current region
         return grass_region
 
-    # read other values from `g.region -g`
+    # read other values from `g.region -gu`
     flgs = 'ug'
     if region3d:
         flgs += '3'



More information about the grass-commit mailing list