Merge pull request #182 from dnnr/serialize-sorted

Sort items before serializing to minimize diff
This commit is contained in:
Guillaume Ayoub 2014-07-28 11:21:48 +02:00
commit 35a0047b38

View File

@ -40,6 +40,7 @@ def serialize(tag, headers=(), items=()):
items if needed (ie. for calendars). items if needed (ie. for calendars).
""" """
items = sorted(items, key=lambda x: x.name)
if tag == "VADDRESSBOOK": if tag == "VADDRESSBOOK":
lines = [item.text for item in items] lines = [item.text for item in items]
else: else: