[GRASS-SVN] r53245 - in grass/trunk/gui/wxpython: dbmgr gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Sep 20 03:28:59 PDT 2012


Author: annakrat
Date: 2012-09-20 03:28:58 -0700 (Thu, 20 Sep 2012)
New Revision: 53245

Modified:
   grass/trunk/gui/wxpython/dbmgr/base.py
   grass/trunk/gui/wxpython/gui_core/preferences.py
Log:
wxGUI/dbmgr: disable fs option in attribute manager for Windows until better solution is found (merge from releasebranch, r53233)

Modified: grass/trunk/gui/wxpython/dbmgr/base.py
===================================================================
--- grass/trunk/gui/wxpython/dbmgr/base.py	2012-09-20 10:27:51 UTC (rev 53244)
+++ grass/trunk/gui/wxpython/dbmgr/base.py	2012-09-20 10:28:58 UTC (rev 53245)
@@ -171,37 +171,28 @@
         # TODO: more effective way should be implemented...
         outFile = tempfile.NamedTemporaryFile(mode = 'w+b')
 
+        cmdParams = dict(quiet = True,
+                         parent = self,
+                         flags = 'c')
+        if sys.platform != "win32":
+            cmdParams.update(dict(sep = fs))
+
         if sql:
+            cmdParams.update(dict(sql = sql,
+                                  output = outFile.name,
+                                  overwrite = True))
             ret = RunCommand('db.select',
-                             overwrite = True,
-                             quiet = True,
-                             parent = self,
-                             flags = 'c',
-                             sep = fs,
-                             sql = sql,
-                             output = outFile.name)
+                             **cmdParams)
         else:
+            cmdParams.update(dict(map = self.mapDBInfo.map,
+                                  layer = layer,
+                                  where = where,
+                                  stdout = outFile))
             if columns:
-                ret = RunCommand('v.db.select',
-                                 quiet = True,
-                                 parent = self,
-                                 flags = 'c',
-                                 map = self.mapDBInfo.map,
-                                 layer = layer,
-                                 columns = ','.join(columns),
-                                 sep = fs,
-                                 where = where,
-                                 stdout = outFile)
-            else:
-                ret = RunCommand('v.db.select',
-                                 quiet = True,
-                                 parent = self,
-                                 flags = 'c',
-                                 map = self.mapDBInfo.map,
-                                 layer = layer,
-                                 sep = fs,
-                                 where = where,
-                                 stdout = outFile) 
+                cmdParams.update(dict(columns = ','.join(columns)))
+
+            ret = RunCommand('v.db.select',
+                             **cmdParams)
         
         # These two should probably be passed to init more cleanly
         # setting the numbers of items = number of elements in the dictionary

Modified: grass/trunk/gui/wxpython/gui_core/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/preferences.py	2012-09-20 10:27:51 UTC (rev 53244)
+++ grass/trunk/gui/wxpython/gui_core/preferences.py	2012-09-20 10:28:58 UTC (rev 53245)
@@ -1143,6 +1143,9 @@
 
         flexSizer.Add(label, proportion = 0, flag = wx.ALIGN_CENTER_VERTICAL)
         flexSizer.Add(separator, proportion = 0, flag = wx.ALIGN_RIGHT | wx.FIXED_MINSIZE)
+        if sys.platform == "win32":
+            label.Hide()
+            separator.Hide()
 
         # ask on delete record
         askOnDeleteRec = wx.CheckBox(parent = panel, id = wx.ID_ANY,



More information about the grass-commit mailing list