mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-18 12:55:52 +00:00
Remember order of items
This commit is contained in:
parent
d824882551
commit
a80fa62927
2 changed files with 2 additions and 3 deletions
|
|
@ -8,6 +8,7 @@
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import collections
|
||||||
|
|
||||||
from .base import Item, Storage
|
from .base import Item, Storage
|
||||||
import vdirsyncer.exceptions as exceptions
|
import vdirsyncer.exceptions as exceptions
|
||||||
|
|
@ -59,8 +60,7 @@ class SingleFileStorage(Storage):
|
||||||
self.wrapper = wrapper
|
self.wrapper = wrapper
|
||||||
|
|
||||||
def list(self):
|
def list(self):
|
||||||
self._items = {}
|
self._items = collections.OrderedDict()
|
||||||
text = None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open(self.path, self._read_mode) as f:
|
with open(self.path, self._read_mode) as f:
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ def split_collection(text, inline=(u'VTIMEZONE',),
|
||||||
|
|
||||||
lines.extend(to_unicode_lines(item))
|
lines.extend(to_unicode_lines(item))
|
||||||
lines.append(end)
|
lines.append(end)
|
||||||
lines.append(u'')
|
|
||||||
|
|
||||||
yield u''.join(line + u'\r\n' for line in lines if line)
|
yield u''.join(line + u'\r\n' for line in lines if line)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue