1
2 """
3 Common class with options that describe the behaviour of the template parser
4 """
5
6 from optparse import OptionGroup
7
10 behaviour=OptionGroup(self.parser,
11 "Behaviour",
12 "The behaviour of the parser")
13 self.parser.add_option_group(behaviour)
14 behaviour.add_option("--tolerant-expression-evaluation",
15 action="store_true",
16 default=False,
17 dest="tolerantRender",
18 help="Instead of failing when encountering a problem during an evaluation a string with the error message is inserted into the output")
19 behaviour.add_option("--allow-exec-instead-of-assignment",
20 action="store_true",
21 default=False,
22 dest="allowExec",
23 help="Allows exectution of non-assignments in $$-lines. This is potentially unsafe as it allows 'import' and calling of external programs")
24
25
26
27