forked from MikMik1011/srbus-tui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
srbus.py
53 lines (35 loc) · 1.14 KB
/
srbus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import questionary
from rich.console import Console
console = Console()
from modules import data, utils, stations, presets, settings, i18n
_ = i18n.getLocale
def mainMenu():
console.clear()
while 1 < 2:
choices = [
_("chooseStation"),
_("choosePreset"),
_("quickStationCheck"),
_("settings"),
_("exit"),
]
console.rule(f"SrBus ({data.config['city']})")
choice = questionary.select(_("chooseOption"), choices).ask()
if choice == _("chooseStation"):
stations.stationsMenu()
elif choice == _("choosePreset"):
presets.presetsMenu()
elif choice == _("quickStationCheck"):
stations.fastStationCheckMenu()
elif choice == _("settings"):
settings.settingsMenu()
elif choice == _("exit"):
console.clear()
console.print(_("exitMsg"))
exit()
console.clear()
if __name__ == "__main__":
i18n.updateLocale(data.config["locale"])
if not data.config["city"] in data.getCities():
settings.citySubmenu()
mainMenu()