added comments
This commit is contained in:
9
main.py
9
main.py
@@ -4,21 +4,26 @@ from dotenv import load_dotenv
|
||||
import os
|
||||
|
||||
def main():
|
||||
# Load the environment
|
||||
load_dotenv(override=True)
|
||||
|
||||
|
||||
# Set up database, webserver and PMT connection
|
||||
db = Database()
|
||||
pmt = PMT()
|
||||
|
||||
|
||||
# fetch PMT shifts
|
||||
pmt.login()
|
||||
|
||||
days_ahead = int(os.environ.get("DAYS_TO_FETCH"))
|
||||
shifts = pmt.get_shifts(days_ahead)
|
||||
PMT.print_shifts(shifts)
|
||||
|
||||
|
||||
# Insert those shifts into the database
|
||||
db.insert_shifts(shifts)
|
||||
|
||||
print(f"\nFound {len(shifts)} shifts total.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user