[GRASS-SVN] r58255 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Nov 19 06:08:09 PST 2013
Author: martinl
Date: 2013-11-19 06:08:09 -0800 (Tue, 19 Nov 2013)
New Revision: 58255
Modified:
grass/trunk/gui/wxpython/gui_core/prompt.py
Log:
wxGUI: don't fail when addon_path contains files with non-ascii characters (TODO: fix it, now the problem is just reported)
Modified: grass/trunk/gui/wxpython/gui_core/prompt.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/prompt.py 2013-11-19 13:30:01 UTC (rev 58254)
+++ grass/trunk/gui/wxpython/gui_core/prompt.py 2013-11-19 14:08:09 UTC (rev 58255)
@@ -20,6 +20,7 @@
import os
import difflib
import codecs
+import sys
import wx
import wx.stc
@@ -392,9 +393,13 @@
try:
if self.toComplete['entity'] == 'command':
for command in globalvar.grassCmd:
- if command.find(self.toComplete['cmd']) == 0:
- dotNumber = list(self.toComplete['cmd']).count('.')
- self.autoCompList.append(command.split('.',dotNumber)[-1])
+ try:
+ if command.find(self.toComplete['cmd']) == 0:
+ dotNumber = list(self.toComplete['cmd']).count('.')
+ self.autoCompList.append(command.split('.',dotNumber)[-1])
+ except UnicodeDecodeError, e: # TODO: fix it
+ sys.stderr.write(DecodeString(command) + ": " + unicode(e))
+
except (KeyError, TypeError):
return
self.ShowList()
More information about the grass-commit
mailing list