débug mycaldav
This commit is contained in:
@@ -184,7 +184,7 @@ class cls_caldav_client():
|
|||||||
if date is None:
|
if date is None:
|
||||||
date = datetime.now()
|
date = datetime.now()
|
||||||
|
|
||||||
tomorow = date + timedelta(days=6)
|
tomorow = date + timedelta(days=7)
|
||||||
self.events = calandar.date_search(
|
self.events = calandar.date_search(
|
||||||
start=datetime(date.year, date.month, date.day), end=datetime(tomorow.year, tomorow.month, tomorow.day), expand=False
|
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_1 = ""
|
||||||
team_2 = ""
|
team_2 = ""
|
||||||
updated = False
|
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
|
if "MC" not in equipage[0]: # check équipage 1
|
||||||
team_1 = equipage[0].strip().replace('#', '')
|
team_1 = equipage[0].strip().replace('#', '')
|
||||||
try:
|
try:
|
||||||
@@ -211,6 +211,8 @@ class cls_caldav_client():
|
|||||||
except :
|
except :
|
||||||
print(f"Error: mc{team_1}@clerc.ch @{summary}")
|
print(f"Error: mc{team_1}@clerc.ch @{summary}")
|
||||||
return None
|
return None
|
||||||
|
else:
|
||||||
|
print("Already with MC")
|
||||||
if "MC" not in equipage[1]: # check équipage 2
|
if "MC" not in equipage[1]: # check équipage 2
|
||||||
team_2 = equipage[1].strip().replace('#','')
|
team_2 = equipage[1].strip().replace('#','')
|
||||||
try:
|
try:
|
||||||
@@ -221,6 +223,8 @@ class cls_caldav_client():
|
|||||||
except :
|
except :
|
||||||
print(f"Error: mc{team_2}@clerc.ch @{summary}")
|
print(f"Error: mc{team_2}@clerc.ch @{summary}")
|
||||||
return None
|
return None
|
||||||
|
else:
|
||||||
|
print("Already with MC")
|
||||||
|
|
||||||
if updated:
|
if updated:
|
||||||
event.vobject_instance.vevent.summary.value = f"{key[0]} - {equipage[0].strip()} & {equipage[1].strip()}"
|
event.vobject_instance.vevent.summary.value = f"{key[0]} - {equipage[0].strip()} & {equipage[1].strip()}"
|
||||||
|
Reference in New Issue
Block a user