Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

drop sort param in diff_iCalStrs(). normalize_iCalStr() always return…

…s params in standard pycalendar order.

git-svn-id: https://svn.calendarserver.org/repository/calendarserver/CalendarServer/trunk@13365 e27351fd-9f3e-4f54-a53b-843176b1656c
  • Loading branch information
bgaya committed Apr 24, 2014
1 parent 563f6c5 commit c842b4dd722243d7988d21f800f45a3fee54fc78
Showing with 8 additions and 21 deletions.
  1. +6 −7 twistedcaldav/ical.py
  2. +2 −14 txdav/who/test/test_group_attendees.py
@@ -3777,16 +3777,15 @@ def normalize_iCalStr(icalstr):
pos = line.find(";X-CALENDARSERVER-DTSTAMP=")
if pos != -1:
lines[ctr] = line[:pos] + line[pos + len(";X-CALENDARSERVER-DTSTAMP=") + 16:]
icalstr = "\r\n".join(lines)
return icalstr + "\r\n"
icalstr = "\r\n".join(lines) + "\r\n"

return str(Component.fromString(icalstr))


def diff_iCalStrs(icalstr1, icalstr2, sort=False):

def diff_iCalStrs(icalstr1, icalstr2):
"""
@param sort: Whether to sort the output
@type sort: L{boolean}
"""
icalstr1 = normalize_iCalStr(icalstr1, sort=sort).splitlines()
icalstr2 = normalize_iCalStr(icalstr2, sort=sort).splitlines()
icalstr1 = normalize_iCalStr(icalstr1).splitlines()
icalstr2 = normalize_iCalStr(icalstr2).splitlines()
return "\n".join(unified_diff(icalstr1, icalstr2))
@@ -111,20 +111,8 @@ def orderMemberValues(event):
attendeeProp.setParameter("MEMBER", sorted(parameterValues))

self.assertEqual(
orderMemberValues(
Component.fromString(
normalize_iCalStr(
iCalStr1
)
)
),
orderMemberValues(
Component.fromString(
normalize_iCalStr(
iCalStr2
)
)
)
orderMemberValues(Component.fromString(normalize_iCalStr(iCalStr1))),
orderMemberValues(Component.fromString(normalize_iCalStr(iCalStr2)))
)


0 comments on commit c842b4d

Please sign in to comment.
You can’t perform that action at this time.