moo.shell.prompt.MooPrompt

class moo.shell.prompt.MooPrompt(user, session=None, mode='rich', site=None)

Interactive prompt session for a connected MOO user.

Runs two concurrent coroutines — process_commands (input loop) and process_messages (Kombu consumer) — that communicate through asyncio.Queue instances and a few asyncio.Event flags. See Inside the Shell Client for the full architecture.

__init__(user, session=None, mode='rich', site=None)
Parameters:
  • user – the authenticated Django user whose avatar is the active player

  • session – the asyncssh session; used by raw mode to reach _chan

  • mode (str) – "rich" (prompt_toolkit) or "raw" (line I/O)

  • site – the Django Site for this connection

Methods

__init__(user[, session, mode, site])

generate_prompt()

Build the prompt message tuple as a stable marker.

handle_command(line)

Dispatch line to the parser and collect its output + published events.

process_commands()

Dispatch to the rich or raw command loop based on self.mode.

process_commands_raw()

Raw-mode REPL loop for traditional MUD clients (TERM=xterm-256-basic).

process_commands_rich()

Rich-mode REPL loop driven by prompt_toolkit.

process_messages()

Kombu consumer loop running alongside process_commands.

run_editor_session(req)

Open the full-screen editor and invoke the callback verb with the result.

run_input_session(req)

Show an inline input prompt and invoke the callback verb with the result.

run_paginator_session(req)

Display the given content in the full-screen paginator.

writer(s[, is_error])

Render a Rich markup string to the terminal.

Attributes

style

prompt-toolkit Style derived from the prompt palette.