[GRASS-SVN] r42622 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jun 21 17:35:50 EDT 2010
Author: martinl
Date: 2010-06-21 21:35:49 +0000 (Mon, 21 Jun 2010)
New Revision: 42622
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
Log:
fix #1084
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py 2010-06-21 19:16:07 UTC (rev 42621)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py 2010-06-21 21:35:49 UTC (rev 42622)
@@ -2178,11 +2178,12 @@
"""!Controls setting options and displaying/hiding map overlay
decorations
"""
- def __init__(self, parent, id, title=_('Set/unset access to mapsets in current location'),
- pos=wx.DefaultPosition, size=(350, 400),
- style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER):
+ def __init__(self, parent, id = wx.ID_ANY,
+ title=_('Set/unset access to mapsets in current location'),
+ size = (350, 400),
+ style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, **kwargs):
- wx.Dialog.__init__(self, parent, id, title, pos, size, style)
+ wx.Dialog.__init__(self, parent, id, title, size = size, style = style, **kwargs)
self.all_mapsets_ordered = utils.ListOfMapsets(ordered=True)
self.accessible_mapsets = utils.ListOfMapsets(accessible=True)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py 2010-06-21 19:16:07 UTC (rev 42621)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py 2010-06-21 21:35:49 UTC (rev 42622)
@@ -221,9 +221,10 @@
if all:
ret = gcmd.RunCommand('g.mapsets',
read = True,
+ fs = ';',
flags = 'l')
if ret:
- mapsets = ret.rstrip('\n').strip().split(' ')
+ mapsets = ret.replace('\n', '').strip().split(';')
else:
raise gcmd.CmdError(cmd = 'g.mapsets',
message = _('Unable to get list of available mapsets.'))
@@ -231,9 +232,10 @@
elif accessible:
ret = gcmd.RunCommand('g.mapsets',
read = True,
+ fs = ';',
flags = 'p')
if ret:
- mapsets = ret.rstrip('\n').strip().split(' ')
+ mapsets = ret.replace('\n', '').strip().split(';')
else:
raise gcmd.CmdError(cmd = 'g.mapsets',
message = _('Unable to get list of accessible mapsets.'))
@@ -241,39 +243,43 @@
elif ordered:
ret = gcmd.RunCommand('g.mapsets',
read = True,
+ fs = ';',
flags = 'l')
if ret:
- mapsets_available = ret.rstrip('\n').strip().split(' ')
+ mapsets_available = ret.replace('\n', '').strip().split(';')
else:
raise gcmd.CmdError(cmd = 'g.mapsets',
message = _('Unable to get list of available mapsets.'))
ret = gcmd.RunCommand('g.mapsets',
read = True,
+ fs = ';',
flags = 'p')
if ret:
- mapsets_accessible = ret.rstrip('\n').strip().split(' ')
+ mapsets_accessible = ret.replace('\n', '').strip().split(';')
else:
raise gcmd.CmdError(cmd = 'g.mapsets',
message = _('Unable to get list of accessible mapsets.'))
for mapset in mapsets_accessible:
mapsets_available.remove(mapset)
+ ListSortLower(mapsets_available)
mapsets = mapsets_accessible + mapsets_available
-
+
else:
ret = gcmd.RunCommand('g.mapsets',
read = True,
+ fs = ';',
flags = 'p')
if ret:
- mapsets = ret.rstrip('\n').strip().split(' ')
+ mapsets = ret.replace('\n', '').strip().split(';')
else:
raise gcmd.CmdError(cmd = 'g.mapsets',
message = _('Unable to get list of accessible mapsets.'))
# This one sorts mapset names, thus prevents the user from modifying their
# order in the SEARH_PATH from GUI, unlike the `ordered' above.
ListSortLower(mapsets)
-
+
return mapsets
def ListSortLower(list):
More information about the grass-commit
mailing list