[GRASS-SVN] r43822 -
grass/branches/develbranch_6/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Oct 7 07:14:46 EDT 2010
Author: martinl
Date: 2010-10-07 11:14:46 +0000 (Thu, 07 Oct 2010)
New Revision: 43822
Modified:
grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
Log:
wxGUI: don't fail if .bash_history is not readable
(merge r43820 from trunk)
Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-10-07 11:13:03 UTC (rev 43821)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py 2010-10-07 11:14:46 UTC (rev 43822)
@@ -436,13 +436,19 @@
# update history file
env = grass.gisenv()
- fileHistory = open(os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'],
- '.bash_history'), 'a')
+ try:
+ fileHistory = open(os.path.join(env['GISDBASE'], env['LOCATION_NAME'], env['MAPSET'],
+ '.bash_history'), 'a')
+ except IOError, e:
+ self.WriteError(str(e))
+ fileHistory = None
+
cmdString = ' '.join(cmdlist)
- try:
- fileHistory.write(cmdString + '\n')
- finally:
- fileHistory.close()
+ if fileHistory:
+ try:
+ fileHistory.write(cmdString + '\n')
+ finally:
+ fileHistory.close()
# update history items
if self.parent.GetName() == 'LayerManager':
More information about the grass-commit
mailing list