pyfcstm.entry.simulate.commands
Command processor for the simulation REPL.
This module provides command parsing and execution for the interactive state machine simulator.
LogLevel
- class pyfcstm.entry.simulate.commands.LogLevel(value)[source]
Log level enumeration for controlling output verbosity.
- Variables:
DEBUG – Show all messages including debug information
INFO – Show informational messages and above
WARNING – Show warnings and errors only
ERROR – Show errors only
OFF – Disable all logging
Settings
- class pyfcstm.entry.simulate.commands.Settings[source]
Runtime settings for the simulator.
- Variables:
table_max_rows (int) – Maximum rows to display in tables before truncating
history_size (int) – Maximum number of history entries to keep
color (bool) – Whether to use ANSI colors
log_level (LogLevel) – Current log level
- get(key: str) Any[source]
Get a setting value.
- Parameters:
key (str) – Setting key
- Returns:
Setting value
- Return type:
Any
- Raises:
KeyError – If key doesn’t exist
CommandResult
CommandProcessor
- class pyfcstm.entry.simulate.commands.CommandProcessor(runtime, state_machine=None, use_color: bool = True)[source]
Processor for handling interactive commands.
This class routes commands to their handlers and manages command execution state including log level.
- Parameters:
runtime (SimulationRuntime) – The simulation runtime instance
- Variables:
display (StateDisplay) – State display formatter
log_level (LogLevel) – Current log level
- __init__(runtime, state_machine=None, use_color: bool = True)[source]
Initialize the command processor.
- Parameters:
runtime (SimulationRuntime) – The simulation runtime instance
state_machine (StateMachine, optional) – The state machine model (required for init command)
use_color (bool, optional) – Whether to use ANSI colors, defaults to True
- process(user_input: str) CommandResult[source]
Process a user command.
- Parameters:
user_input (str) – The raw user input string
- Returns:
Command execution result
- Return type: