我試圖訪問我的日曆的所有事件,託管在Nextcloud上,用python和caldav庫。 有了這個代碼:Python Caldav,所有日曆都沒有名稱
client = caldav.DAVClient(url) #like "https://..../nextcloud/remote.php/dav/calendars
principal = client.principal()
calendars = principal.calendars()
我可以訪問我所有的日曆和遍歷它。
我如何只能讀取名爲「calendar_name」的特定日曆?在這種情況下,我得到的所有日曆,即使我指定的日曆名稱:
client = caldav.DAVClient(url) #like "https://..../nextcloud/remote.php/dav/calendars/user/calendar_name
principal = client.principal()
calendars = principal.calendars()
如果我改變與日曆中的最後一行代碼,我得到一個空數組。
calendar = principal.calendar('calendar_name')
注:我可以訪問所有的日曆和事件與公佈的第一個代碼,但所有的名字都是「無」,即使地址是正確的。
請顯示您用來訪問日曆名稱的代碼(然後是None)。 – hnh