Don't use the VADDRESSBOOK tag anymore (closes #667)
This commit is contained in:
parent
c84a250476
commit
8dcc613f0a
@ -31,18 +31,15 @@ import uuid
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
|
|
||||||
|
|
||||||
def serialize(tag, headers=(), items=(), whole=False):
|
def serialize(tag, headers=(), items=()):
|
||||||
"""Return a text corresponding to given collection ``tag``.
|
"""Return a text corresponding to given collection ``tag``.
|
||||||
|
|
||||||
The text may have the given ``headers`` and ``items`` added around the
|
The text may have the given ``headers`` and ``items`` added around the
|
||||||
items if needed (ie. for calendars).
|
items if needed (ie. for calendars).
|
||||||
|
|
||||||
If ``whole`` is ``True``, the collection tags and headers are added, even
|
|
||||||
for address books.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if tag == "VADDRESSBOOK" and not whole:
|
if tag == "VADDRESSBOOK":
|
||||||
lines = [items[0].text]
|
lines = [item.text for item in items]
|
||||||
else:
|
else:
|
||||||
lines = ["BEGIN:%s" % tag]
|
lines = ["BEGIN:%s" % tag]
|
||||||
for part in (headers, items):
|
for part in (headers, items):
|
||||||
|
Loading…
Reference in New Issue
Block a user