[GRASS-SVN] r35982 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 20 07:15:09 EST 2009


Author: martinl
Date: 2009-02-20 07:15:09 -0500 (Fri, 20 Feb 2009)
New Revision: 35982

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


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-02-20 12:08:37 UTC (rev 35981)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/location_wizard.py	2009-02-20 12:15:09 UTC (rev 35982)
@@ -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/develbranch_6/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2009-02-20 12:08:37 UTC (rev 35981)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/utils.py	2009-02-20 12:15:09 UTC (rev 35982)
@@ -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)
@@ -354,6 +355,15 @@
     return (cmd[0],
             dcmd)
 
+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