-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.py
executable file
·127 lines (108 loc) · 2.64 KB
/
main.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/env python3
import argparse
import os
import sys
def main():
parser = argparse.ArgumentParser(description="Lesson Manager:")
parser.add_argument(
"-ca",
"--calendar",
help="Parse google calendar.",
action="store_true",
)
parser.add_argument(
"-gc",
"--get-course",
metavar="CRN",
help="Get course info from CRN number. Seperate by comma.",
)
parser.add_argument(
"-ic",
"--init-courses",
help="Initalize all courses.",
action="store_true",
)
parser.add_argument(
"-ra",
"--rofi-assignments",
help="View assignments.",
action="store_true",
)
parser.add_argument(
"-rb",
"--rofi-books",
help="View books.",
action="store_true",
)
parser.add_argument(
"-rc",
"--rofi-courses",
help="View courses.",
action="store_true",
)
parser.add_argument(
"-rn",
"--rofi-notes",
help="View notes.",
action="store_true",
)
parser.add_argument(
"-rsn",
"--rofi-strip-notes",
help="Strip Notes.",
action="store_true",
)
parser.add_argument(
"-rsno",
"--rofi-strip-notes-output",
help="Stripped notes output.",
default="output.tex",
)
parser.add_argument(
"-sn",
"--source-notes",
help="Source notes.",
action="store_true",
)
parser.add_argument(
"-yn",
"--sync-notes",
help="Sync notes to google drive.",
action="store_true",
)
args = parser.parse_args()
os.chdir(sys.path[0])
if args.calendar:
import src.countdown as ca
print("Waiting for connection")
ca.check_internet()
ca.main()
if args.get_course:
import src.get_course as gc
gc.main(args.get_course)
if args.init_courses:
import src.init_courses as ic
ic.main()
if args.rofi_assignments:
import src.rofi_assignments as ra
ra.main()
if args.rofi_books:
import src.rofi_books as rb
rb.main()
if args.rofi_courses:
import src.rofi_courses as rc
rc.main()
if args.rofi_notes:
import src.rofi_notes as rn
rn.main()
if args.rofi_strip_notes:
import src.rofi_strip_notes as rsn
rsn.main(args.rofi_strip_notes_output)
if args.source_notes:
import src.source_notes as sn
sn.main()
if args.sync_notes:
import src.sync_notes as sy
sy.main()
if __name__ == "__main__":
main()