Use component names to filter duplicates

This commit is contained in:
Unrud 2016-01-15 01:09:43 +01:00
parent 9bc8635bdf
commit 5081fcbcd1

View File

@ -80,7 +80,7 @@ class Collection(filesystem.Collection):
def text(self): def text(self):
components = ( components = (
ical.Timezone, ical.Event, ical.Todo, ical.Journal, ical.Card) ical.Timezone, ical.Event, ical.Todo, ical.Journal, ical.Card)
items = set() items = {}
try: try:
filenames = os.listdir(self._filesystem_path) filenames = os.listdir(self._filesystem_path)
except (OSError, IOError) as e: except (OSError, IOError) as e:
@ -99,7 +99,7 @@ class Collection(filesystem.Collection):
'Error while reading item %r: %r' % (path, e)) 'Error while reading item %r: %r' % (path, e))
return ical.serialize( return ical.serialize(
self.tag, self.headers, sorted(items, key=lambda x: x.name)) self.tag, self.headers, sorted(items.values(), key=lambda x: x.name))
@classmethod @classmethod
def is_node(cls, path): def is_node(cls, path):