débug mycaldav

This commit is contained in:
Ambulance Clerc
2022-10-13 17:34:14 +02:00
parent 0ab73625d7
commit 7ad87670b3

View File

@@ -184,7 +184,7 @@ class cls_caldav_client():
if date is None:
date = datetime.now()
tomorow = date + timedelta(days=6)
tomorow = date + timedelta(days=7)
self.events = calandar.date_search(
start=datetime(date.year, date.month, date.day), end=datetime(tomorow.year, tomorow.month, tomorow.day), expand=False
)
@@ -200,7 +200,7 @@ class cls_caldav_client():
team_1 = ""
team_2 = ""
updated = False
print(f"check équipage({key[0]}) {key[1]}")
print(f"{event.vobject_instance.vevent.dtstart.value} check équipage({key[0]}) {key[1]}")
if "MC" not in equipage[0]: # check équipage 1
team_1 = equipage[0].strip().replace('#', '')
try:
@@ -211,6 +211,8 @@ class cls_caldav_client():
except :
print(f"Error: mc{team_1}@clerc.ch @{summary}")
return None
else:
print("Already with MC")
if "MC" not in equipage[1]: # check équipage 2
team_2 = equipage[1].strip().replace('#','')
try:
@@ -221,6 +223,8 @@ class cls_caldav_client():
except :
print(f"Error: mc{team_2}@clerc.ch @{summary}")
return None
else:
print("Already with MC")
if updated:
event.vobject_instance.vevent.summary.value = f"{key[0]} - {equipage[0].strip()} & {equipage[1].strip()}"