abacura.mud package

Subpackages

Submodules

abacura.mud.session module

MUD session handler

class abacura.mud.session.Session(name: str)[source]

Bases: BaseSession

Main User Session Class

abacura: Abacura

Dependency descriptor for dependencies specified as class level annotations

config: Config

Dependency descriptor for dependencies specified as class level annotations

connect(name: str, host: str = '', port: int = 0) None[source]

@connect <name> <host> <port> to connect a game session

launch_screen()[source]

Fired on screen mounting, so our Footer is updated and Session gets a TextLog handle

output(msg, markup: bool = False, highlight: bool = False, ansi: bool = False, actionable: bool = True, gag: bool = False, loggable: bool = True)[source]

Write to TextLog for this screen

player_input(line) None[source]

This is entry point of the inputbar on the screen

register_options()[source]

Set up telnet options handlers

send(msg: str, raw: bool = False) None[source]

Send to writer (socket), raw will send the message without byte translation

session_command(name: str = '') None[source]

@session <name>: Get information about sessions or swap to session <name>

async telnet_client(host: str, port: int) None[source]

async worker to handle input/output on socket

abacura.mud.session.load_class(class_name: str, default=None)[source]

dynamically load a class

Module contents

class abacura.mud.BaseSession[source]

Bases: object

output(msg, **kwargs)[source]

Subclasses will handle this

show_exception(msg: str, exc: Exception, show_tb: bool = True)[source]

Show an exception with optional traceback

class abacura.mud.OutputMessage(message: str, gag: bool)[source]

Bases: object

ansi_escape = re.compile('\\x1B(?:[@-Z\\\\-_]|\\[[0-?]*[ -/]*[@-~])')