Merge pull request #351 from Unrud/patch-6
Quick fix for multifilesystem
This commit is contained in:
commit
3a4184d1ab
@ -72,6 +72,8 @@ class Collection(filesystem.Collection):
|
|||||||
"Can't tranlate name safely to filesystem, "
|
"Can't tranlate name safely to filesystem, "
|
||||||
"skipping component: %s", name)
|
"skipping component: %s", name)
|
||||||
return
|
return
|
||||||
|
if name in self.items:
|
||||||
|
del self.items[name]
|
||||||
filesystem_path = os.path.join(self._filesystem_path, name)
|
filesystem_path = os.path.join(self._filesystem_path, name)
|
||||||
if os.path.exists(filesystem_path):
|
if os.path.exists(filesystem_path):
|
||||||
os.remove(filesystem_path)
|
os.remove(filesystem_path)
|
||||||
@ -80,7 +82,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 +101,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):
|
||||||
|
Loading…
Reference in New Issue
Block a user