[GRASS-SVN] r38103 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 27 15:27:38 EDT 2009
Author: martinl
Date: 2009-06-27 15:27:38 -0400 (Sat, 27 Jun 2009)
New Revision: 38103
Modified:
grass/trunk/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: don't crash when history file is missing
Modified: grass/trunk/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/prompt.py 2009-06-27 19:10:43 UTC (rev 38102)
+++ grass/trunk/gui/wxpython/gui_modules/prompt.py 2009-06-27 19:27:38 UTC (rev 38103)
@@ -386,9 +386,16 @@
def SetHistoryItems(self):
"""!Read history file and update combobox items"""
env = grass.gisenv()
- fileHistory = open(os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'],
- '.bash_history'), 'r')
try:
+ fileHistory = open(os.path.join(env['GISDBASE'],
+ env['LOCATION_NAME'],
+ env['MAPSET'],
+ '.bash_history'), 'r')
+ except IOError:
+ self.SetItems([])
+ return
+
+ try:
hist = []
for line in fileHistory.readlines():
hist.append(line.replace('\n', ''))
More information about the grass-commit
mailing list