[GRASS-SVN] r35981 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 20 07:08:37 EST 2009


Author: martinl
Date: 2009-02-20 07:08:37 -0500 (Fri, 20 Feb 2009)
New Revision: 35981

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
Log:
wxGUI: fix MS Windows-related bugs in Location Wizard (osgeo4w #37)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py	2009-02-20 11:20:23 UTC (rev 35980)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py	2009-02-20 12:08:37 UTC (rev 35981)
@@ -37,6 +37,7 @@
 import string
 import sys
 import locale
+import platform
 
 import wx
 import wx.lib.mixins.listctrl as listmix
@@ -261,6 +262,7 @@
                                              "coordinate system (XY)"))
         # layout
         self.sizer.AddGrowableCol(1)
+        self.sizer.SetVGap(10)
         self.sizer.Add(item=self.radio1,
                        flag=wx.ALIGN_LEFT, pos=(1, 1))
         self.sizer.Add(item=self.radio2,
@@ -1238,7 +1240,7 @@
                                        style=wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL)
 
         # text input
-        epsgdir = os.path.join(os.environ["GRASS_PROJSHARE"], 'epsg')
+        epsgdir = utils.PathJoin(os.environ["GRASS_PROJSHARE"], 'epsg')
         self.tfile = self.MakeTextCtrl(text=epsgdir, size=(200,-1))
         self.tcode = self.MakeTextCtrl(size=(200,-1))
 
@@ -1397,9 +1399,10 @@
             i = 0
             code = None
             for line in f.readlines():
-
                 line = line.strip()
-
+                if len(line) < 1:
+                    continue
+                
                 if line[0] == '#':
                     descr = line[1:].strip()
                 elif line[0] == '<':

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2009-02-20 11:20:23 UTC (rev 35980)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/utils.py	2009-02-20 12:08:37 UTC (rev 35981)
@@ -16,6 +16,7 @@
 
 import os
 import sys
+import platform
 
 import globalvar
 grassPath = os.path.join(globalvar.ETCDIR, "python")
@@ -50,7 +51,7 @@
 
     # FIXME
     # ugly hack for MSYS (MS Windows)
-    if subprocess.mswindows:
+    if platform.system() == 'Windows':
 	tempfile = tempfile.replace("/", "\\")
     try:
         path, file = os.path.split(tempfile)
@@ -322,6 +323,15 @@
     
     return str(d) + ':' + m + ':' + s
 
+def PathJoin(*args):
+    """Check path created by os.path.join"""
+    path = os.path.join(*args)
+    if platform.system() == 'Windows' and \
+            '/' in path:
+        return path[1].upper() + ':\\' + path[3:].replace('/', '\\')
+    
+    return path
+    
 def reexec_with_pythonw():
     """Re-execute Python on Mac OS"""
     if sys.platform == 'darwin' and \



More information about the grass-commit mailing list