woom.context.Context#
- class woom.context.Context(workflow, task_name=None, cycle=None, member=None, extra_params=None)[source]#
Dict-like context that is used by jinja to fill templates
Its content is accessible with keys like:
context = Context(workflow, task_name, cycle, member) print(context["task"].name)
See Input context for a list of available keys.
Note
Some of the items are available as attributes, like
workflow.- __init__(workflow, task_name=None, cycle=None, member=None, extra_params=None)[source]#
Initialize rendering context
Attributes
The workflow configuration
The current
Cycleinstance or NoneA
dictof environment variables as declared in the workflow configurationThe current
Memberinstance or NoneA
dictof user parameters as declared in the 'params' section of the workflow configurationThe current
Tasksinstance or NoneThe current
WorkflowinstanceMethods
clear()copy()fromkeys(iterable[, value])get(k[,d])items()keys()pop(k[,d])If key is not found, d is returned if given, otherwise KeyError is raised.
popitem()as a 2-tuple; but raise KeyError if D is empty.
setdefault(k[,d])to_json()Export context to json
update([E, ]**F)If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values()