Package PyFoam :: Package Basics :: Module TemplateFile :: Class TemplateFileOldFormat
[hide private]
[frames] | no frames]

Class TemplateFileOldFormat

source code


Works on template files. Does calculations between $$. Lines that start with $$ contain definitions

Instance Methods [hide private]
 
__init__(self, name=None, content=None)
Exactly one of the parameters must be specified
source code
 
buildTemplate(self, template) source code
 
getString(self, vals)
In the template, replaces all the strings between $$ with the evaluation of the expressions
source code
 
writeToFile(self, outfile, vals)
In the template, replaces all the strings between $$ with the evaluation of the expressions and writes the results to a file
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name=None, content=None)
(Constructor)

source code 

Exactly one of the parameters must be specified

Parameters:
  • name - name of the template file.
  • content - Content of the template
Overrides: object.__init__

getString(self, vals)

source code 

In the template, replaces all the strings between $$ with the evaluation of the expressions

Parameters:
  • vals - dictionary with the values
Returns:
The string with the replaced expressions

writeToFile(self, outfile, vals)

source code 

In the template, replaces all the strings between $$ with the evaluation of the expressions and writes the results to a file

Parameters:
  • outfile - the resulting output file
  • vals - dictionary with the values