28 lines
757 B
Python
28 lines
757 B
Python
from shell.Handlers.ABS import Handler
|
|
from shell.Handlers.PythonappHandler import PythonappHandler
|
|
from shell.Handlers.ModelSpaceHandler import ModelSpaceHandler
|
|
|
|
|
|
class GlobalHandler(Handler):
|
|
def __init__(self):
|
|
super().__init__()
|
|
self.forwarding_table: dict[str, Handler] = {
|
|
'pythonapp': PythonappHandler(),
|
|
'modelspace': ModelSpaceHandler(),
|
|
}
|
|
self.handle_table: dict = {
|
|
'tell': self._tell
|
|
|
|
}
|
|
|
|
def _tell(self, command: list[str], pos = 0):
|
|
command_str = ''
|
|
for word in command[pos:]: command_str += word + ' '
|
|
print(command_str)
|
|
self.succeed = True
|
|
|
|
def _exit(self, command: list[str], pos = 0):
|
|
raise KeyboardInterrupt
|
|
|
|
|