summaryrefslogtreecommitdiff
path: root/python_modules
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2011-05-19 15:59:07 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2012-03-20 15:25:53 +0100
commita11615f71391c1ef7e578eaec1c57fcd0f076420 (patch)
tree84187267617206c9d3d29129b2baadefc74bc0e8 /python_modules
parentda5cad88e37f8d3968cb8639e91ca803f8a84d02 (diff)
add check for pyparsing
Check both in configure.ac (after checking if we need to rebuild the marshalling files) and in the python script using pyparsing (for people modifying .proto files in tarballs)
Diffstat (limited to 'python_modules')
-rw-r--r--python_modules/spice_parser.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python_modules/spice_parser.py b/python_modules/spice_parser.py
index 4c8a57a..e20e8fc 100644
--- a/python_modules/spice_parser.py
+++ b/python_modules/spice_parser.py
@@ -1,6 +1,11 @@
-from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, ZeroOrMore, \
- Forward, delimitedList, Group, Optional, Combine, alphas, nums, restOfLine, cStyleComment, \
- alphanums, ParseException, ParseResults, Keyword, StringEnd, replaceWith
+try:
+ from pyparsing import Literal, CaselessLiteral, Word, OneOrMore, ZeroOrMore, \
+ Forward, delimitedList, Group, Optional, Combine, alphas, nums, restOfLine, cStyleComment, \
+ alphanums, ParseException, ParseResults, Keyword, StringEnd, replaceWith
+except ImportError:
+ print "Module pyparsing not found."
+ exit(1)
+
import ptypes
import sys