From e545df572232460178d814f56f7ba2d9374b770c Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Sun, 25 Sep 2011 21:15:17 +0200 Subject: [PATCH] Only set the principal tag for root folders (related to #580) --- radicale/ical.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/radicale/ical.py b/radicale/ical.py index 6122460e..53a292aa 100644 --- a/radicale/ical.py +++ b/radicale/ical.py @@ -208,12 +208,13 @@ class Calendar(object): path = "/".join(attributes) abs_path = os.path.join(FOLDER, path.replace("/", os.sep)) + principal = len(attributes) <= 1 if os.path.isdir(abs_path): if depth == "0": - result.append(cls(path, principal=True)) + result.append(cls(path, principal)) else: if include_container: - result.append(cls(path, principal=True)) + result.append(cls(path, principal)) try: for filename in next(os.walk(abs_path))[2]: if cls.is_vcalendar(os.path.join(abs_path, filename)): @@ -225,7 +226,7 @@ class Calendar(object): if depth == "0": result.append(cls(path)) else: - calendar = cls(path, principal=True) + calendar = cls(path, principal) if include_container: result.append(calendar) result.extend(calendar.components)