Coverage for bugscpp/processor/command_list.py : 93%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2Controller
4There should be no deep logic
5"""
6from collections.abc import Mapping
7from typing import Iterator
9from processor.core.command import RegisteredCommands
12class CommandList(Mapping):
13 _commands = RegisteredCommands()
15 def __init__(self, *args, **kwargs):
16 pass
18 def __getitem__(self, key: str):
19 return self._commands[self._keytransform(key)]
21 def __iter__(self) -> Iterator:
22 return iter(self._commands)
24 def __len__(self) -> int:
25 return len(self._commands)
27 def _keytransform(self, key: str):
28 return key