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

Source Code for Module PyFoam.Applications.EchoDictionary

 1  #  ICE Revision: $Id: /local/openfoam/Python/PyFoam/PyFoam/Applications/EchoDictionary.py 5136 2009-05-25T17:32:57.099791Z bgschaid  $  
 2  """ 
 3  Application class that implements pyFoamEchoDictionary 
 4  """ 
 5   
 6  import sys,re 
 7   
 8  from PyFoamApplication import PyFoamApplication 
 9   
10  from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile 
11   
12  from CommonParserOptions import CommonParserOptions 
13   
14 -class EchoDictionary(PyFoamApplication, 15 CommonParserOptions):
16 - def __init__(self,args=None):
17 description=""" 18 Reads a Foam-Dictionary and prints it to the screen. Mainly for reformatting 19 unformated dictionaries and debugging the parser 20 """ 21 22 PyFoamApplication.__init__(self, 23 args=args, 24 description=description, 25 usage="%prog [options] <dictfile>", 26 nr=1, 27 changeVersion=False, 28 interspersed=True)
29
30 - def addOptions(self):
32
33 - def run(self):
34 fName=self.parser.getArgs()[0] 35 try: 36 dictFile=ParsedParameterFile(fName, 37 backup=False, 38 debug=self.opts.debugParser, 39 noHeader=self.opts.noHeader, 40 noBody=self.opts.noBody, 41 boundaryDict=self.opts.boundaryDict, 42 listDict=self.opts.listDict, 43 listDictWithHeader=self.opts.listDictWithHeader, 44 doMacroExpansion=self.opts.doMacros) 45 except IOError,e: 46 self.error("Problem with file",fName,":",e) 47 48 print dictFile
49