Files
aitbc/cli/parser_context.py
aitbc 90b525254b
Some checks failed
CLI Tests / test-cli (push) Failing after 3s
Integration Tests / test-service-integration (push) Successful in 1m57s
Production Tests / Production Integration Tests (push) Successful in 17s
Python Tests / test-python (push) Successful in 22s
Security Scanning / security-scan (push) Successful in 2m43s
aitbc: implement lazy loading for module imports to improve startup performance
2026-04-27 10:28:25 +02:00

29 lines
837 B
Python

"""Shared parser context for unified CLI command registration."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Callable, Mapping
@dataclass(slots=True)
class ParserContext:
default_rpc_url: str
default_coordinator_url: str
cli_version: str
first: Callable[..., Any]
read_password: Callable[..., Any]
output_format: Callable[..., Any]
render_mapping: Callable[..., Any]
read_blockchain_env: Callable[..., Any]
normalize_rpc_url: Callable[..., Any]
probe_rpc_node: Callable[..., Any]
get_network_snapshot: Callable[..., Any]
handlers: Mapping[str, Callable[..., Any]]
def __getattr__(self, name: str):
try:
return self.handlers[name]
except KeyError as exc:
raise AttributeError(name) from exc