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

Class PyratempPreprocessor

source code


This class preprocesses the input that is give to it in such a way that the old format (using $$ at the line beginnings and $ .. $ for expressions) is reworked into something that pyratemp understands

Instance Methods [hide private]
 
__call__(self, original)
This does the actual work
source code
 
__init__(self, dovarline=True, doexpr=True, expressionDelimiter='$', assignmentLineStart='$$', allowExec=False, specials=[])
Create the regexp once for performance reasons
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, dovarline=True, doexpr=True, expressionDelimiter='$', assignmentLineStart='$$', allowExec=False, specials=[])
(Constructor)

source code 

Create the regexp once for performance reasons

Parameters:
  • dovarline - look for variable lines that start with $$
  • doexpr - substitute expressions that are between $
  • expressionDelimiter - character/string that is used before and after an expression. After the expression the reverse of the string is used
  • assignmentLineStart - character sequence that signals an assignment line
  • allowExec - allows execution of code. This is potentially unsafe
  • specials - a list. If any expression starts with one of these values then the full expression (including delimiters) is left verbatim in the template
Overrides: object.__init__