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

Source Code for Module PyFoam.Applications.CommonParserOptions

 1  """ 
 2  Class that implements the common functionality for passing options to the parser 
 3  """ 
 4  from optparse import OptionGroup 
 5   
6 -class CommonParserOptions(object):
7 """ The class that defines the options for the parser 8 """ 9
10 - def addOptions(self):
11 parser=OptionGroup(self.parser, 12 "Parser Options", 13 "Options that control the behaviour of the parser for the dictionary files") 14 self.parser.add_option_group(parser) 15 parser.add_option("--debug-parser", 16 action="store_true", 17 default=None, 18 dest="debugParser" 19 ,help="Debugs the parser") 20 21 parser.add_option("--no-header", 22 action="store_true", 23 default=False, 24 dest="noHeader", 25 help="Don't expect a header while parsing") 26 27 parser.add_option("--no-body", 28 action="store_true", 29 default=False, 30 dest="noBody", 31 help="Don't expect a body while parsing (only parse the header)") 32 33 parser.add_option("--boundary", 34 action="store_true", 35 default=False, 36 dest="boundaryDict", 37 help="Expect that this file is a boundary dictionary") 38 39 parser.add_option("--list-only", 40 action="store_true", 41 default=False, 42 dest="listDict", 43 help="Expect that this file only contains a list") 44 45 parser.add_option("--list-with-header", 46 action="store_true", 47 default=False, 48 dest="listDictWithHeader", 49 help="Expect that this file only contains a list with a header") 50 51 parser.add_option("--do-macro-expansion", 52 action="store_true", 53 default=False, 54 dest="doMacros", 55 help="Expand macros with $ and #")
56