瀏覽代碼

Order the mapset names, make the current mapset the first entry in the list

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@60024 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 11 年之前
父節點
當前提交
5ed3a2e25a
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      lib/python/temporal/c_libraries_interface.py

+ 10 - 1
lib/python/temporal/c_libraries_interface.py

@@ -69,8 +69,17 @@ def available_mapsets(lock, conn, data):
                 char_list += mapset[c]
                 c += 1
                 
-        mapset_list.append(char_list)   
+        mapset_list.append(char_list) 
         
+    # We need to sort the mapset list, but the first one should be 
+    # the current mapset
+    current_mapset = libgis.G_mapset()
+    mapset_list.remove(current_mapset)
+    mapset_list.sort()
+    mapset_list.reverse()
+    mapset_list.append(current_mapset)
+    mapset_list.reverse()
+
     conn.send(mapset_list) 
 
 def _has_timestamp(lock, conn, data):