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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 10 14:53:57 EDT 2009


Author: cmbarton
Date: 2009-03-10 14:53:57 -0400 (Tue, 10 Mar 2009)
New Revision: 36317

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py
Log:
Fixed not creating location in new GISDbase.

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-03-10 18:53:33 UTC (rev 36316)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/location_wizard.py	2009-03-10 18:53:57 UTC (rev 36317)
@@ -46,6 +46,7 @@
 import gcmd
 import globalvar
 import utils
+import grass
 try:
     import subprocess
 except:
@@ -1850,6 +1851,21 @@
             dlg.ShowModal()
             dlg.Destroy()
             return False
+        
+        # current GISDbase or a new one?
+        current_gdb = grass.gisenv()['GISDBASE']
+        if current_gdb != database:
+            # change to new GISDbase or create new one
+            if os.path.isdir(database) != True:
+                # create new directory
+                os.mkdir(database)
+                
+            # change to new GISDbase directory
+            grass.run_command('g.gisenv', set='GISDBASE=%s' % database)
+            wx.MessageBox(parent=self.wizard,
+                                message=_("You will need to change the default GIS data directory in the GRASS startup screen"),
+                                caption=("Location <%s> will be created in GIS data directory <%s>") % \
+                                    (location,database), style=wx.OK | wx.ICON_ERROR)
 
         if coordsys == "xy":
             success = self.XYCreate()



More information about the grass-commit mailing list