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

Class EvalPseudoSandboxWithMath

source code


Add mathematical functions to the valid functons

Instance Methods [hide private]
 
__init__(self, allowExec=False) source code
 
compile(self, expr, mode='eval')
Compile a python-eval-expression.
source code
 
eval(self, expr, locals)
Eval a python-eval-expression.
source code
    Inherited from ThirdParty.pyratemp.EvalPseudoSandbox
 
f_default(self, expr, default=None)
``default()`` for the sandboxed code.
source code
 
f_exists(self, varname)
``exists()`` for the sandboxed code.
source code
 
f_import(self, name, *args, **kwargs)
``import``/``__import__()`` for the sandboxed code.
source code
 
f_setvar(self, name, expr)
``setvar()`` for the sandboxed code.
source code
 
register(self, name, obj)
Add an object to the "allowed eval-globals".
source code
Class Variables [hide private]
    Inherited from ThirdParty.pyratemp.EvalPseudoSandbox
  safe_builtins = {'abs': <built-in function abs>, 'bool': <type...
  safe_builtins_python2 = {'False': '__builtin__.False', 'None':...
Method Details [hide private]

__init__(self, allowExec=False)
(Constructor)

source code 
Overrides: ThirdParty.pyratemp.EvalPseudoSandbox.__init__

compile(self, expr, mode='eval')

source code 

Compile a python-eval-expression. Overrides the default implementation to allow '_[1]' as a valid name

Overrides: ThirdParty.pyratemp.EvalPseudoSandbox.compile

eval(self, expr, locals)

source code 

Eval a python-eval-expression.

Sets ``self.locals_ptr`` to ``locales`` and compiles the code before evaluating.

Overrides: ThirdParty.pyratemp.EvalPseudoSandbox.eval