Package PyFoam :: Package Applications :: Module CommonTemplateBehaviour
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.Applications.CommonTemplateBehaviour

 1  #  ICE Revision: $Id$ 
 2  """ 
 3  Common class with options that describe the behaviour of the template parser 
 4  """ 
 5   
 6  from optparse import OptionGroup 
 7   
8 -class CommonTemplateBehaviour(object):
9 - def addOptions(self):
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 # Should work with Python3 and Python2 27