[GRASS-SVN] r55596 - grass/trunk/lib/python/pygrass/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 3 01:13:38 PDT 2013


Author: zarch
Date: 2013-04-03 01:13:38 -0700 (Wed, 03 Apr 2013)
New Revision: 55596

Modified:
   grass/trunk/lib/python/pygrass/gis/__init__.py
Log:
Change new_mapset from a method of the class to a function

Modified: grass/trunk/lib/python/pygrass/gis/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/gis/__init__.py	2013-04-02 21:16:14 UTC (rev 55595)
+++ grass/trunk/lib/python/pygrass/gis/__init__.py	2013-04-03 08:13:38 UTC (rev 55596)
@@ -59,6 +59,11 @@
                                                  join(path, value)))
 
 
+def make_mapset(mapset, location=None, gisdbase=None):
+    if libgis.G__make_mapset(gisdbase, location, mapset) != 0:
+        raise GrassError("I cannot create a new mapset.")
+
+
 class Gisdbase(object):
     """Return Gisdbase object. ::
 
@@ -191,11 +196,7 @@
         """
         return [mapset for mapset in self]
 
-    def new_mapset(self, mapset):
-        if libgis.G__make_mapset(self.gisdbase, self.location, mapset) != 0:
-            raise GrassError("I cannot create a new mapset.")
 
-
 class Mapset(object):
     """Mapset ::
 



More information about the grass-commit mailing list