abacura package

Subpackages

Submodules

abacura.abacura module

Main Textual App and Entrypoint

class abacura.abacura.Abacura[source]

Bases: App

A Textual mudclient

AUTO_FOCUS: ClassVar[str | None] = 'InputBar'

A selector to determine what to focus automatically when a screen is activated.

The widget focused is the first that matches the given [CSS selector](/guide/queries/#query-selectors). Setting to None or “” disables auto focus.

BINDINGS: ClassVar[list[BindingType]] = [('ctrl+d', 'toggle_dark', 'Toggle dark mode'), ('ctrl+q', 'quit', 'Quit'), ('f3', 'reload_config', 'f3'), Binding(key='f12', action='toggle_inspector', description='Toggle Inspector', show=True, key_display=None, priority=False)]
CSS_PATH: ClassVar[CSSPathType | None] = ['./css/abacura.css']

File paths to load CSS from.

SCREENS: ClassVar[dict[str, Screen | Callable[[], Screen]]] = {}

Screens associated with the app for the lifetime of the app.

START_SESSION: str | None

Dependency descriptor for dependencies specified as class level annotations

action_reload_config() None[source]
action_toggle_inspector() None[source]
config: Config

Dependency descriptor for dependencies specified as class level annotations

create_session(name: str) None[source]

Create a session

inspector: bool

Dependency descriptor for dependencies specified as class level annotations

on_mount() None[source]

When app is mounted, create first session

screens: Dict[Session, Screen]

Dependency descriptor for dependencies specified as class level annotations

set_session(id: str) None[source]

abacura.config module

Abacura configuration module

class abacura.config.Config(**kwargs)[source]

Bases: object

Base configuration class

property config
get_specific_option(section: str, key: str, default=None) Any[source]

Get configuration value for section, global, or default

name = 'config'
reload() None[source]

Reload configuration file from disk

Module contents

Main screen and widgets for abacura

class abacura.AbacuraSuggester(session)[source]

Bases: Suggester

add_entry(value) None[source]
async get_suggestion(value: str) Coroutine[Any, Any, str | None][source]

Try to get a completion suggestion for the given input value.

Custom suggesters should implement this method.

Note:

The value argument will be casefolded if self.case_sensitive is False.

Note:

If your implementation is not deterministic, you may need to disable caching.

Args:

value: The current value of the requester widget.

Returns:

A valid suggestion or None.

class abacura.InputBar(id: str = '')[source]

Bases: Input

BINDINGS: ClassVar[list[BindingType]] = [('up', 'history_scrollback', None), ('down', 'history_scrollforward', None), ('tab', 'cursor_right', None)]

player input line

class UserCommand(command: str)[source]

Bases: Message

Message object to bubble up inputs with

bubble: ClassVar[bool] = True
handler_name: ClassVar[str] = 'on_input_bar_user_command'

Name of the default message handler.

no_dispatch: ClassVar[bool] = False
time
verbose: ClassVar[bool] = False
action_history_scrollback() None[source]
action_history_scrollforward() None[source]
can_focus: bool = True

Widget may receive focus.

can_focus_children: bool = True

Widget’s children may receive focus.

on_input_submitted(message: Submitted) None[source]

Bubble-up player input and blank the bar

on_mount()[source]
async stop_input_change_propagation(message) None[source]
class abacura.SessionScreen(name: str)[source]

Bases: Screen

Default Screen for sessions

AUTO_FOCUS: ClassVar[str | None] = 'InputBar'

A selector to determine what to focus automatically when the screen is activated.

The widget focused is the first that matches the given [CSS selector](/guide/queries/#query-selectors). Set to None to inherit the value from the screen’s app. Set to “” to disable auto focus.

BINDINGS: ClassVar[list[BindingType]] = [('pageup', 'pageup', 'PageUp'), ('pagedown', 'pagedown', 'PageDown'), ('f2', 'toggle_sidebar', 'F2'), ('f3', 'toggle_commslog', 'F3')]
action_pagedown() None[source]
action_pageup() None[source]
action_toggle_commslog() None[source]
action_toggle_dark() None[source]

Dark mode

action_toggle_sidebar() None[source]
can_focus: bool = False

Widget may receive focus.

can_focus_children: bool = True

Widget’s children may receive focus.

compose() Iterable[Widget][source]

Create child widgets for the session

config: Config

Dependency descriptor for dependencies specified as class level annotations

async on_input_bar_user_command(command: UserCommand) None[source]

Handle user input from InputBar

on_mount() None[source]

Screen is mounted, launch it

session: Session

Dependency descriptor for dependencies specified as class level annotations