dev temporaire

This commit is contained in:
Ambulance Clerc
2022-06-30 18:51:04 +02:00
parent 8f8807fea9
commit b3c4e32611
2 changed files with 35 additions and 18 deletions

View File

@@ -52,24 +52,7 @@ def view_op_caldav(request):
@xframe_options_exempt
def view_dayly_caldav(request):
ret = ""
caldav_url = "https://sync.infomaniak.com"
caldav_user = 'SC01066'
caldav_password = "mc144*1870CLERC"
myClient = cls_caldav_client()
client = cal.DAVClient(url=caldav_url, username=caldav_user, password=caldav_password)
my_principal = client.principal()
calendars = my_principal.calendars()
if calendars:
## Some calendar servers will include all calendars you have
## access to in this list, and not only the calendars owned by
## this principal.
print("your principal has %i calendars:" % len(calendars))
ret += "your principal has %i calendars:" % len(calendars)
for c in calendars:
print(" Name: %-20s URL: %s" % (c.name, c.url))
ret += " Name: %-20s URL: %s" % (c.name, c.url) + "<br>\n"
else:
print("your principal has no calendars")
return HttpResponse(ret)