[GRASS-SVN] r66115 - grass/branches/releasebranch_7_0/lib/python/temporal

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 5 09:33:02 PDT 2015


Author: neteler
Date: 2015-09-05 09:33:02 -0700 (Sat, 05 Sep 2015)
New Revision: 66115

Modified:
   grass/branches/releasebranch_7_0/lib/python/temporal/c_libraries_interface.py
Log:
temporal library: Fixed wrong mapset access method (partial backport from trunk, r66014)

Modified: grass/branches/releasebranch_7_0/lib/python/temporal/c_libraries_interface.py
===================================================================
--- grass/branches/releasebranch_7_0/lib/python/temporal/c_libraries_interface.py	2015-09-05 16:21:25 UTC (rev 66114)
+++ grass/branches/releasebranch_7_0/lib/python/temporal/c_libraries_interface.py	2015-09-05 16:33:02 UTC (rev 66115)
@@ -133,7 +133,7 @@
         # This behavior is in conjunction with db.connect
         dbstring = dbstring.replace("$GISDBASE", libgis.G_gisdbase())
         dbstring = dbstring.replace("$LOCATION_NAME", libgis.G_location())
-        dbstring = dbstring.replace("$MAPSET", libgis.G_mapset())
+        dbstring = dbstring.replace("$MAPSET", mapset)
     conn.send(dbstring)
 
 ###############################################################################
@@ -148,15 +148,17 @@
 
        :returns: Names of available mapsets as list of strings
     """
-    
+
     count = 0
     mapset_list = []
     try:
+        # Initilaize the accessable mapset list, this is bad C design!!!
+        libgis.G_get_mapset_name(0)
         mapsets = libgis.G_get_available_mapsets()
         while mapsets[count]:
             char_list = ""
             mapset = mapsets[count]
-            if libgis.G_mapset_permissions(mapset) > 0:
+            if libgis.G_mapset_permissions(mapset) == 1 and libgis.G_is_mapset_in_search_path(mapset) == 1:
                 c = 0
                 while mapset[c] != "\x00":
                     char_list += mapset[c]



More information about the grass-commit mailing list