Jelajahi Sumber

Change new_mapset from a method of the class to a function

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55596 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 12 tahun lalu
induk
melakukan
a9b4604930
1 mengubah file dengan 5 tambahan dan 4 penghapusan
  1. 5 4
      lib/python/pygrass/gis/__init__.py

+ 5 - 4
lib/python/pygrass/gis/__init__.py

@@ -59,6 +59,11 @@ def _check(value, path, type):
                                                  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,10 +196,6 @@ class Location(object):
         """
         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 ::