Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class View:
- self._controller = controller
- self.actions = {'a': self._controller.method1,
- 'b': self._controller.method2,
- ...}
- def main_cycle(self):
- ...
- ...
- while not self._model.stop_cycle():
- action = self._view.request_action()
- try:
- self._view.actions[action]()
- except KeyError:
- self._view.show_error_input()
- class View:
- ...
- ...
- def view_component(self):
- param1 = input('Enter param1')
- return param1
Add Comment
Please, Sign In to add comment