[GRASS-SVN] r46883 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 1 03:14:02 EDT 2011
Author: martinl
Date: 2011-07-01 00:14:02 -0700 (Fri, 01 Jul 2011)
New Revision: 46883
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: external formats dialog - fix save settings
(merge r46882 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2011-07-01 07:13:11 UTC (rev 46882)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gselect.py 2011-07-01 07:14:02 UTC (rev 46883)
@@ -1243,19 +1243,24 @@
gcmd.GMessage(parent = self,
message = _("Name not given, settings is not saved."))
return
-
- data = self._loadSettings()
+
+ name = dlg.GetValue()
try:
- fd = open(self.settingsFile, 'w')
- fd.write(dlg.GetValue() + ';' + self.dsnType + ';' +
+ fd = open(self.settingsFile, 'a')
+ fd.write(name + ';' + self.dsnType + ';' +
self._getDsn() + ';' +
self.format.GetStringSelection())
fd.write('\n')
except IOError:
gcmd.GError(parent = self,
- message = _("Unable to save settings."))
+ message = _("Unable to save settings"))
return
fd.close()
+
+ self._settings = self._loadSettings()
+ self.settingsChoice.Append(name)
+ self.settingsChoice.SetStringSelection(name)
+
dlg.Destroy()
def _loadSettings(self):
@@ -1466,7 +1471,7 @@
if format == 'SQLite' or format == 'Rasterlite':
win = self.input['db-win']['file']
elif format == 'PostgreSQL' or format == 'PostGIS WKT Raster driver':
- if grass.find_program('psql'):
+ if grass.find_program('psql', ['--help']):
win = self.input['db-win']['choice']
if not win.GetItems():
p = grass.Popen(['psql', '-ltA'], stdout = grass.PIPE)
More information about the grass-commit
mailing list