Package logsparser :: Module normalizer :: Class CallbackFunction

[frames] | no frames]

# Class CallbackFunction

source code

    object --+
             |
            CallbackFunction

This class is used to define a callback function from source code present in the XML configuration file. The function is defined in a sanitized environment (imports are disabled, for instance). This class is inspired from this recipe : http://code.activestate.com/recipes/550804-create-a-restricted-python-function-from-a-string/

Instance Methods

__init__(self, function_body=`'``log[\'test\'] = value``'`, name=`'``unknown``'`) x.__init__(...) initializes x; see help(type(x)) for signature | source code

__call__(self, value, log) call the instance as a function to run the callback. | source code

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

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, function_body=`'``log[\'test\'] = value``'`, name=`'``unknown``'`)
(Constructor)

source code

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
  (inherited documentation)