Преглед на файлове

Match stupid naming conventions used by Apple's clients for collections

Guillaume Ayoub преди 12 години
родител
ревизия
61eedc2b7c
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      radicale/ical.py

+ 4 - 1
radicale/ical.py

@@ -212,7 +212,10 @@ class Collection(object):
         attributes = sane_path.split("/")
         if not attributes:
             return []
-        if not (cls.is_leaf("/".join(attributes)) or path.endswith("/")):
+
+        # Try to guess if the path leads to a collection or an item
+        if not (cls.is_leaf("/".join(attributes)) or
+                path.endswith(("/", ".ics", ".vcf", "/caldav", "/carddav"))):
             attributes.pop()
 
         result = []