Bootstrap the mauzr agent on cpython systems.

class mauzr.platform.cpython.Core(suit, agent, instance=None, parser=None)

Bases: object

Manage program components on cpython platforms.

The core can either be started directly by calling run() or by using it as a context manager. The first case blocks, the second case spawns a thread that is running the scheduler.

  • suit (str) – Suit this agent belongs to.
  • agent (str) – Name of the agent.
  • instance (str) – Instance of this agent. May be None
  • parser (argparse.ArgumentParser) – Argparse instance to use. If None, a new one will be used.

Add a context to be managed by this core.

Parameters:context (object) – Unit to be added
static logger(name)

Create a logger instance.

Parameters:name (str) – Name of the caller that wants to receive the logger.
Returns:Logger instance.
Return type:logging.Logger
static on_failure()

Call when an unrecoverable failure happens.

Shuts the program down.


Setup modules and units and run the scheduler.

Block until shutdown is requested.

setup_telegram(*args, **kwargs)

Setup a telegram bot.

See mauzr.platform.cpython.telegram.Bot.


Ask the agent to shut down.