-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouter.py
More file actions
17 lines (13 loc) · 744 Bytes
/
router.py
File metadata and controls
17 lines (13 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from controller import Controller
class Router:
main_menu_option_handler = int()
controller_methods = {1: Controller.get_team_absolute_statistic, 2: Controller.get_several_teams_absolute_statistics,
3: Controller.get_team_detailed_statistic, 4: Controller.get_team_statistic_by_season,
5: Controller.make_refresh, 6: Controller.create_backup, 7: Controller.download_backup}
def __init__(self, main_menu_option):
self.main_menu_option_handler = main_menu_option
def route(self):
if self.main_menu_option_handler in range(1, 8):
self.controller_methods[self.main_menu_option_handler]()
else:
raise Exception('Unknown option')