Minor fixes and add TODO.md

This commit is contained in:
Abdulkadir Furkan Şanlı 2018-12-13 10:00:22 +01:00
parent 9db07eaa97
commit 2e7fa574bd
2 changed files with 17 additions and 9 deletions

11
TODO.md Normal file
View File

@ -0,0 +1,11 @@
To-Do List
==========
## v0.2
- [ ] Error handling
- [ ] Make database contain data for all classes
- [ ] Flexible mandatory subjects
## v1.0
- [ ] make main() purely functional
- [ ] timetable editor

View File

@ -98,27 +98,24 @@ def main():
print("============")
db = input(
"Please enter name of database (in same folder as program): ")
conn = connect_database(db)
y = "y"
while y == "y":
conn = connect_database(db)
day = get_lower_weekday()
id = int(input("Please input the student ID number: "))
if check_id(conn, id):
day = get_lower_weekday()
raw_time = select_final_time(conn, day, id)
final_time = parse_time_string(
raw_time) if raw_time != None else None
if final_time != None:
# if raw_time is None, student has no lessons today
if raw_time != None:
final_time = parse_time_string(raw_time)
current_time = parse_time_string(time.strftime("%H:%M"))
if current_time > final_time:
print("Clear to leave.")
else:
print("Student does not have clearance.")
elif final_time == None:
elif raw_time == None:
print("Clear to leave.")
else:
print("Student does not exist in the database. Please try again.")