Преглед на файлове

g.search.modules: print error msg if python-termcolor is not installed

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67001 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler преди 9 години
родител
ревизия
9f4a688960
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      scripts/g.search.modules/g.search.modules.py

+ 4 - 1
scripts/g.search.modules/g.search.modules.py

@@ -143,7 +143,10 @@ def colorize(text, attrs=None, pattern=None):
     
 
     if COLORIZE:
-        from termcolor import colored
+        try:
+            from termcolor import colored
+        except ImportError:
+            grass.fatal(_("Cannot colorize, python-termcolor is not installed"))
     else:
         def colored(pattern, attrs):
             return pattern