make it a bit more logical structure
This commit is contained in:
6
main.py
6
main.py
@@ -1,6 +1,7 @@
|
||||
from PMT import PMT
|
||||
from DB import Database
|
||||
from dotenv import load_dotenv
|
||||
from time import sleep
|
||||
import os
|
||||
|
||||
def main():
|
||||
@@ -18,10 +19,11 @@ def main():
|
||||
|
||||
days_ahead = int(os.environ.get("DAYS_TO_FETCH"))
|
||||
shifts = pmt.get_shifts(days_ahead)
|
||||
PMT.print_shifts(shifts)
|
||||
|
||||
db.delete_future_shifts() # delete all future shifts before importing, to make sure if a shift is removed, it actually gets removed here too.
|
||||
|
||||
|
||||
# Insert those shifts into the database
|
||||
# Insert the new shifts into the database
|
||||
db.insert_shifts(shifts)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user