-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (27 loc) · 885 Bytes
/
main.py
File metadata and controls
35 lines (27 loc) · 885 Bytes
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
"""A handy countdown timer for mastering time management in Lightning talks or other short presentations."""
import argparse
import sys
import tkinter as tk
from lightimer.ui import LightimerApp
def _parse_args(argv: list[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Lightimer countdown timer")
parser.add_argument(
"-l",
"--lean",
action="store_true",
help="start in lean mode",
)
parser.add_argument(
"-s",
"--sound-file",
dest="sound_file",
help="path to a WAV or MP3 file used for the times-up notification",
)
return parser.parse_args(argv)
def main() -> None:
args = _parse_args(sys.argv[1:])
root = tk.Tk()
app = LightimerApp(master=root, lean=args.lean, sound_file=args.sound_file)
app.mainloop()
if __name__ == "__main__":
main()