moo.core.code.ContextManager

class moo.core.code.ContextManager(caller, writer, task_id=None, player=None, connection=None, track_events=False, site=None)

The ContextManager class is what holds critical per-execution information such as the active user and writer. It uses contextvars to maintain this information across asynchronous calls.

This contextmanager should really only be used once per top-level request, such as when a user invokes a verb or issues a command in the console. Nested uses of this contextmanager are supported for unit testing purposes, since eager Celery execution means that verb invocations within verbs happen synchronously.

__init__(caller, writer, task_id=None, player=None, connection=None, track_events=False, site=None)

Methods

__init__(caller, writer[, task_id, player, ...])

get(name)

get_perm_cache()

get_prop_lookup_cache()

get_site()

get_verb_lookup_cache()

is_active()

override_caller(caller[, this, verb_name, ...])

pop_caller()

set_parser(parser)

set_site(site)