mirror of
https://github.com/assenzostefano/class-website.git
synced 2025-06-06 00:39:12 +02:00
Reordering comments and functions
This commit is contained in:
@ -1,8 +1,8 @@
|
|||||||
import os
|
|
||||||
from imbox import Imbox
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
|
from imbox import Imbox
|
||||||
import traceback
|
import traceback
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
# Load .env file
|
# Load .env file
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
@ -4,6 +4,7 @@ import openpyxl as xl
|
|||||||
import datetime
|
import datetime
|
||||||
import pymongo
|
import pymongo
|
||||||
import urllib
|
import urllib
|
||||||
|
import time
|
||||||
import os
|
import os
|
||||||
|
|
||||||
load_dotenv() #Load .env file
|
load_dotenv() #Load .env file
|
||||||
@ -15,8 +16,11 @@ database = client["website-class"] #Database name
|
|||||||
collection = database["school-time-table"] #Collection school time table current
|
collection = database["school-time-table"] #Collection school time table current
|
||||||
collection_archive = database["archive-school-time-table"] #Collection school time table archive
|
collection_archive = database["archive-school-time-table"] #Collection school time table archive
|
||||||
|
|
||||||
x = collection.delete_many({}) #Delete all documents in collection (school-time-table)
|
def recheck():
|
||||||
|
time.sleep(10)
|
||||||
|
update_time_school()
|
||||||
|
|
||||||
|
def update_time_school():
|
||||||
# Load excel file
|
# Load excel file
|
||||||
namefile_xlsx = "attachments/school_time.xlsx"
|
namefile_xlsx = "attachments/school_time.xlsx"
|
||||||
workbook = xl.load_workbook(filename=namefile_xlsx)
|
workbook = xl.load_workbook(filename=namefile_xlsx)
|
||||||
@ -37,6 +41,7 @@ mydict = {
|
|||||||
"School Subject": [],
|
"School Subject": [],
|
||||||
"Teacher": [],
|
"Teacher": [],
|
||||||
}
|
}
|
||||||
|
x = collection.delete_many({}) #Delete all documents in collection (school-time-table)
|
||||||
x = collection.insert_one(mydict) # Add collection on collection (school-time-table)
|
x = collection.insert_one(mydict) # Add collection on collection (school-time-table)
|
||||||
x = collection_archive.insert_one(mydict) # Add collection on collection (archive-school-time-table)
|
x = collection_archive.insert_one(mydict) # Add collection on collection (archive-school-time-table)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user