Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
Check
Browse files Browse the repository at this point in the history
  • Loading branch information
tweirtx committed Feb 8, 2020
1 parent abaa4d1 commit d936a84
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion timetracker/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,20 @@ def exitme():
exit(0)


def check():
with Session() as session:
user = input("Please enter the user ID you would like to check: ")
result = session.query(Members).filter_by(user_id=user).one_or_none()
if result is None:
print("That user ID does not exist!")
return
else:
hours = result.minutes / 60
print(f"{result.name} has {hours} hours on record!")


available_commands = {'signout': signout, 'adduser': add_users.run_console, 'edit': edit,
'return': "call break later", 'exit': exitme, 'autoreport': report}
'return': "call break later", 'exit': exitme, 'autoreport': report, 'check': check}
command_string = "Available commands: \n"
for command_name in available_commands.keys():
command_string += command_name + "\n"
Expand Down

0 comments on commit d936a84

Please sign in to comment.