ContextValue

class guerilla.ContextValue

Bases: guerilla.ContextControlNode

A ContextValue node allows routing a Plug value based on the current context

Context

The message plug that dependends on all inputs, and on which all outputs depend

Type:None
static getplugincontext(plug, context)

Get the plug value for a specific context

Parameters:
  • plug (Plug) – The plug to get
  • context (str or None) – The context name, or nil for the default value
Returns:

The value of the plug for the given context

Return type:

any

static setplug(plug, value)

Overrides a plug value for the current context, or set the plug default value when no context is active

Parameters:
  • plug (Plug) – The plug to override
  • value (any) – The value to set in the context
static setplugincontext(plug, value, context)

Overrides a plug value for the current context, or set the plug default value when no context is active

Parameters:
  • plug (Plug) – The plug to override
  • value (any) – The value to set in the context
  • context (str or None) – The context name, or nil for the default value