Compare commits

...

2 Commits

Author SHA1 Message Date
Stefano Assenzo 14b7a724ae
Remove inutil lines of code 2023-01-27 20:30:47 +00:00
Stefano Assenzo b4eb0a0b29
Now find the classes we do PE with even though we have multiple times a week 2023-01-27 20:30:11 +00:00
1 changed files with 73 additions and 5 deletions

View File

@ -43,41 +43,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
}, "PE with": "",
{
"Subject": "",
"Teacher": "",
"Room": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
},
{
"Subject": "",
"Teacher": "",
"Room": "",
"PE with": "",
}, },
], ],
"Tuesday": [ "Tuesday": [
@ -85,41 +93,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
], ],
"Wednesday": [ "Wednesday": [
@ -127,41 +143,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
], ],
"Thursday": [ "Thursday": [
@ -169,41 +193,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
], ],
"Friday": [ "Friday": [
@ -211,41 +243,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
], ],
"Saturday": [ "Saturday": [
@ -253,41 +293,49 @@ def update_time_school():
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
{ {
"Subject": "", "Subject": "",
"Teacher": "", "Teacher": "",
"Room": "", "Room": "",
"PE with": "",
}, },
], ],
} }
@ -323,6 +371,7 @@ def update_time_school():
school_subject = ws.cell(row=i, column=column).value # Get school subject from excel file school_subject = ws.cell(row=i, column=column).value # Get school subject from excel file
teacher = ws.cell(row=i, column=column+1).value teacher = ws.cell(row=i, column=column+1).value
room = ws.cell(row=i, column=column+2).value room = ws.cell(row=i, column=column+2).value
print(school_subject)
if dont_repeat == 9: if dont_repeat == 9:
check_repeat += 1 check_repeat += 1
if check_repeat == 5: if check_repeat == 5:
@ -576,4 +625,23 @@ def update_time_school():
if gagaga_room == 8: if gagaga_room == 8:
gagaga_room = 0 gagaga_room = 0
# Look for other classes doing PE at the same time as us
if school_subject == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or school_subject == "CEAM EDUCAZIONE ATTIVITA' MOTORIE":
for c in range(1,100):
search_motoria = ws.cell(row=i, column=c).value
if search_motoria == "CEAM EDUCAZIONE ATTIVITA' MOTORIE" or search_motoria == "CEAM EDUCAZIONE ATTIVITA' MOTORIE":
if c == column:
print("Non valido")
print("Row " + str(i) + " Column " + str(c) + " is " + school_subject)
else:
search_class = ws.cell(row=3, column=c).value
collection.update_one(
{ "_id": ObjectId(array_document_school_time_table)},
{ "$set": {
"School Subject." + array_test[0] + "." + str(gagaga_room)+ ".PE with": search_class,
}
}
)
else:
print("")
update_time_school() update_time_school()