[GRASS-SVN] r46882 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jul 1 03:13:11 EDT 2011
Author: martinl
Date: 2011-07-01 00:13:11 -0700 (Fri, 01 Jul 2011)
New Revision: 46882
Modified:
grass/trunk/gui/wxpython/gui_modules/gselect.py
Log:
wxGUI: external formats dialog - fix save settings
Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2011-06-30 22:52:14 UTC (rev 46881)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2011-07-01 07:13:11 UTC (rev 46882)
@@ -1270,19 +1270,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):
@@ -1493,7 +1498,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