[GRASS-SVN] r67496 - grass-addons/grass7/vector/v.mapcalc
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jan 5 19:39:43 PST 2016
Author: wenzeslaus
Date: 2016-01-05 19:39:43 -0800 (Tue, 05 Jan 2016)
New Revision: 67496
Modified:
grass-addons/grass7/vector/v.mapcalc/v.mapcalc.py
Log:
v.mapcalc: simple fix to make basic run possible without PLY (Lex and Yacc implementation)
Modified: grass-addons/grass7/vector/v.mapcalc/v.mapcalc.py
===================================================================
--- grass-addons/grass7/vector/v.mapcalc/v.mapcalc.py 2016-01-06 03:23:04 UTC (rev 67495)
+++ grass-addons/grass7/vector/v.mapcalc/v.mapcalc.py 2016-01-06 03:39:43 UTC (rev 67496)
@@ -24,8 +24,7 @@
#% required: yes
#%end
-import ply.lex as lex
-import ply.yacc as yacc
+
import sys
import re
import os
@@ -415,6 +414,14 @@
p.cmdlist.get_cmd_list()
p.cmdlist.exec_cmd_list()
+
if __name__ == "__main__":
options, flags = grass.parser()
+
+ try:
+ import ply.lex as lex
+ import ply.yacc as yacc
+ except ImportError as error:
+ grass.fatal("You need to install Python PLY: {}".format(error))
+
sys.exit(main())
More information about the grass-commit
mailing list