[GRASS-SVN] r61884 - in grass/trunk/lib/python/pygrass/modules: . grid

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 12 09:11:53 PDT 2014


Author: zarch
Date: 2014-09-12 09:11:53 -0700 (Fri, 12 Sep 2014)
New Revision: 61884

Modified:
   grass/trunk/lib/python/pygrass/modules/grid/grid.py
   grass/trunk/lib/python/pygrass/modules/shortcuts.py
Log:
pygrass: Fix doctest

Modified: grass/trunk/lib/python/pygrass/modules/grid/grid.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/grid/grid.py	2014-09-12 16:10:14 UTC (rev 61883)
+++ grass/trunk/lib/python/pygrass/modules/grid/grid.py	2014-09-12 16:11:53 UTC (rev 61884)
@@ -36,7 +36,7 @@
     ...              elevation='ele', slope='slp', aspect='asp',
     ...              run_=False)
     >>> for rast in select(slp.outputs, 'raster'):
-    ...     print rast
+    ...     print(rast)
     ...
     slp
     asp
@@ -86,8 +86,8 @@
     [u'PERMANENT', u'user1']
     >>> sorted(os.listdir(os.path.join(path, 'PERMANENT')))
     [u'DEFAULT_WIND', u'PROJ_INFO', u'PROJ_UNITS', u'VAR', u'WIND']
-    >>> sorted(os.listdir(os.path.join(path, 'user1')))
-    [u'CURGROUP', u'SEARCH_PATH', u'VAR', u'WIND']
+    >>> sorted(os.listdir(os.path.join(path, 'user1'))) # doctest: +ELLIPSIS
+    [...u'SEARCH_PATH', u'VAR', u'WIND']
     >>> import shutil
     >>> shutil.rmtree(path)
 
@@ -308,7 +308,7 @@
     ...              elevation='ele', slope='slp', aspect='asp',
     ...              overwrite=True, run_=False)
     >>> get_cmd(slp.get_dict())  # doctest: +ELLIPSIS
-    ['r.slope.aspect', 'elevation=ele', 'format=degrees', ..., '--o']
+    ['r.slope.aspect', u'elevation=ele', u'format=degrees', ..., u'--o']
     """
     cmd = [cmdd['name'], ]
     cmd.extend(("%s=%s" % (k, v) for k, v in cmdd['inputs']
@@ -391,7 +391,7 @@
     :param run_: if False only instantiate the object
     :type run_: bool
     :param args: give all the parameters to the command
-    :param kargs: give all the parameters to the command 
+    :param kargs: give all the parameters to the command
 
     >>> grd = GridModule('r.slope.aspect',
     ...                  width=500, height=500, overlap=2,

Modified: grass/trunk/lib/python/pygrass/modules/shortcuts.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/shortcuts.py	2014-09-12 16:10:14 UTC (rev 61883)
+++ grass/trunk/lib/python/pygrass/modules/shortcuts.py	2014-09-12 16:11:53 UTC (rev 61884)
@@ -28,8 +28,9 @@
        >>> g_mlist.inputs.type = 'rast'
        >>> g_mlist.stdout_ = -1
        >>> g_mlist.run()
+       Module('g.mlist')
        >>> g_mlist.outputs.stdout                         # doctest: +ELLIPSIS
-       'basins...soils...'
+       '...basins...soils...'
        >>> r = MetaModule('r')
        >>> what = r.what
        >>> what.description



More information about the grass-commit mailing list