[GRASS-SVN] r31201 - in grass/trunk/gui/wxpython: . gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 1 17:33:57 EDT 2008


Author: martinl
Date: 2008-05-01 17:33:57 -0400 (Thu, 01 May 2008)
New Revision: 31201

Modified:
   grass/trunk/gui/wxpython/gui_modules/dbm.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: MS Windows related fixes (spaces in database path) [sync'ed with develbr6]

Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-05-01 21:32:45 UTC (rev 31200)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py	2008-05-01 21:33:57 UTC (rev 31201)
@@ -3030,16 +3030,22 @@
         # list of available layers & (table, database, driver)
         for line in layerCommand.ReadStdOutput():
             lineList = line.split(' ')
-            if '/' in lineList[0]:
-                lineList[0], layer_name = lineList[0].split('/')
+            layer = lineList[0]
+            if '/' in layer:
+                layer, layer_name = lineList[0].split('/')
             else:
                 layer_name = None
-            self.layers[int(lineList[0])] = {
+            # database can contain ' ' in it's path
+            if len(lineList) > 5:
+                database = ''.join(lineList[3:-1])
+            else:
+                database = lineList[3]
+            self.layers[int(layer)] = {
                 "name"     : layer_name,
                 "table"    : lineList[1],
                 "key"      : lineList[2],
-                "database" : lineList[3],
-                "driver"   : lineList[4]
+                "database" : database,
+                "driver"   : lineList[-1]
                 }
             
         if (len(self.layers.keys()) == 0):

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2008-05-01 21:32:45 UTC (rev 31200)
+++ grass/trunk/gui/wxpython/wxgui.py	2008-05-01 21:33:57 UTC (rev 31201)
@@ -580,8 +580,11 @@
             file = open(filename, "r")
 
             fileStream = ''.join(file.readlines())
-            p = re.compile( '(grass-gxw.dtd)')
+            p = re.compile('(grass-gxw.dtd)')
             p.search(fileStream)
+            if subprocess.mswindows:
+                # FIXME mixing '\' and '/' causes error in p.sub
+                dtdFilename = dtdFilename.replace("\\", "/") 
             fileStream = p.sub(dtdFilename, fileStream)
 
             # sax



More information about the grass-commit mailing list