[GRASS-SVN] r35832 - in grass/trunk: general/g.mapsets gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 9 14:53:49 EST 2009


Author: martinl
Date: 2009-02-09 14:53:49 -0500 (Mon, 09 Feb 2009)
New Revision: 35832

Modified:
   grass/trunk/general/g.mapsets/g.mapsets.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
Log:
use '|' as delimiter for g.mapsets
hide group column in g.mapsets dialog


Modified: grass/trunk/general/g.mapsets/g.mapsets.py
===================================================================
--- grass/trunk/general/g.mapsets/g.mapsets.py	2009-02-09 19:49:52 UTC (rev 35831)
+++ grass/trunk/general/g.mapsets/g.mapsets.py	2009-02-09 19:53:49 UTC (rev 35832)
@@ -97,7 +97,7 @@
         """Load data into list"""
         self.InsertColumn(0, 'Mapset')
         self.InsertColumn(1, 'Owner')
-        self.InsertColumn(2, 'Group')
+        ### self.InsertColumn(2, 'Group')
 
         gisenv = grass.gisenv()
         locationPath = os.path.join(gisenv['GISDBASE'], gisenv['LOCATION_NAME'])
@@ -105,18 +105,18 @@
         
         ret = grass.read_command('g.mapsets',
                                  flags = 'l',
-                                 fs = ';')
+                                 fs = '|')
         self.mapsets = []
         if ret:
-            self.mapsets = ret.replace('\n', '').split(';')
+            self.mapsets = ret.rstrip('\n').split('|')
             
 
         ret = grass.read_command('g.mapsets',
                                  flags = 'p',
-                                 fs = ';')
+                                 fs = '|')
         mapsets_access = []
         if ret:
-            mapsets_access = ret.replace('\n', '').split(';')
+            mapsets_access = ret.rstrip('\n').split('|')
             
         for mapset in self.mapsets:
             index = self.InsertStringItem(sys.maxint, mapset)
@@ -126,11 +126,11 @@
 	    if os.name in ('posix', 'mac'):
                 self.SetStringItem(index, 1, "%s" % pwd.getpwuid(stat_info.st_uid)[0])
                 # FIXME: get group name
-                self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid) 
+                ### self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid) 
 	    else:
                 # FIXME: no pwd under MS Windows (owner: 0, group: 0)
                 self.SetStringItem(index, 1, "%-8s" % stat_info.st_uid)
-                self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid)
+                ### self.SetStringItem(index, 2, "%-8s" % stat_info.st_gid)
 
             if mapset in mapsets_access:
                 self.CheckItem(self.mapsets.index(mapset), True)

Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2009-02-09 19:49:52 UTC (rev 35831)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2009-02-09 19:53:49 UTC (rev 35832)
@@ -205,19 +205,21 @@
     if all:
         ret = gcmd.RunCommand('g.mapsets',
                               read = True,
-                              flags = 'l')
+                              flags = 'l',
+                              fs = '|')
     
         if ret:
-            mapsets = ret.rstrip('\n').strip().split(' ')
+            mapsets = ret.rstrip('\n').split('|')
         else:
             raise gcmd.CmdError(cmd = 'g.mapsets',
                                 message = _('Unable to get list of available mapsets.'))
     else:
         ret = gcmd.RunCommand('g.mapsets',
                               read = True,
-                              flags = 'p')
+                              flags = 'p',
+                              fs = '|')
         if ret:
-            mapsets = ret.rstrip('\n').strip().split(' ')
+            mapsets = ret.rstrip('\n').split('|')
         else:
             raise gcmd.CmdError(cmd = 'g.mapsets',
                                 message = _('Unable to get list of accessible mapsets.'))



More information about the grass-commit mailing list