Guest User

Untitled

a guest
Mar 24th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. class View:
  2. self._controller = controller
  3. self.actions = {'a': self._controller.method1,
  4. 'b': self._controller.method2,
  5. ...}
  6.  
  7. def main_cycle(self):
  8. ...
  9. ...
  10. while not self._model.stop_cycle():
  11. action = self._view.request_action()
  12. try:
  13. self._view.actions[action]()
  14. except KeyError:
  15. self._view.show_error_input()
  16.  
  17. class View:
  18. ...
  19. ...
  20. def view_component(self):
  21. param1 = input('Enter param1')
  22. return param1
Add Comment
Please, Sign In to add comment