Debug export PDF
This commit is contained in:
@@ -120,15 +120,16 @@ class cls_caldav():
|
||||
self.day.sort(key=lambda x: x.key, reverse=reverse)
|
||||
self.night.sort(key=lambda x: x.key, reverse=reverse)
|
||||
|
||||
def caldav_open_url(self, days_delta, date):
|
||||
def caldav_open_url(self, days_delta, dest_date):
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
self.clear_data()
|
||||
|
||||
|
||||
modified_url = self.url + f"&start={int((date-timedelta(days=days_delta)).timestamp())}&end={int((date +timedelta(days=days_delta)).timestamp())}&expand=1"
|
||||
if not isinstance(dest_date, datetime):
|
||||
dest_date = datetime.strptime(dest_date, '%y-%m-%d')
|
||||
modified_url = self.url + f"&start={int((dest_date-timedelta(days=days_delta)).timestamp())}&end={int((dest_date +timedelta(days=days_delta)).timestamp())}&expand=1"
|
||||
print(f"ICS CALL URL = {modified_url}")
|
||||
with urllib.request.urlopen(modified_url, context=ctx) as o_url:
|
||||
self.data = o_url.read()
|
||||
@@ -139,7 +140,8 @@ class cls_caldav():
|
||||
if date is None:
|
||||
date = datetime.now()
|
||||
|
||||
self.caldav_open_url(days_delta=periode,date=date)
|
||||
|
||||
self.caldav_open_url(days_delta=periode,dest_date=date.strftime("%y-%m-%d"))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user