[CalendarServer-changes] [6713] CalendarServer/trunk/lib-patches/vobject

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 3 12:15:05 PST 2011


Revision: 6713
          http://trac.macosforge.org/projects/calendarserver/changeset/6713
Author:   cdaboo at apple.com
Date:     2011-01-03 12:14:59 -0800 (Mon, 03 Jan 2011)
Log Message:
-----------
Make sure \-sequences in ADR are handled properly.

Modified Paths:
--------------
    CalendarServer/trunk/lib-patches/vobject/vobject.icalendar.patch
    CalendarServer/trunk/lib-patches/vobject/vobject.vcard.patch

Modified: CalendarServer/trunk/lib-patches/vobject/vobject.icalendar.patch
===================================================================
--- CalendarServer/trunk/lib-patches/vobject/vobject.icalendar.patch	2011-01-03 20:13:25 UTC (rev 6712)
+++ CalendarServer/trunk/lib-patches/vobject/vobject.icalendar.patch	2011-01-03 20:14:59 UTC (rev 6713)
@@ -8,19 +8,29 @@
  # although it isn't actually supposed to be escaped according to rfc2445 TEXT
 -escapableCharList = '\\;,Nn"'
  
+-def stringToTextValues(s, listSeparator=',', charList=None, strict=False):
 +# COLON included to work around Address Book's escaping it in vCard data,
 +# despite the fact that it is similarly not supposed to be escaped.
 +
 +escapableCharList = '\\;:,Nn'
 +
- def stringToTextValues(s, listSeparator=',', charList=None, strict=False):
++def stringToTextValues(s, listSeparator=',', charList=None, strict=False, leaveEscapes=False):
      """Returns list of strings."""
 -    
 +
      if charList is None:
          charList = escapableCharList
  
-@@ -1675,9 +1679,10 @@
+@@ -1656,6 +1660,8 @@
+         if state == "read normal":
+             if char == '\\':
+                 state = "read escaped char"
++                if leaveEscapes:
++                    current.append(char)
+             elif char == listSeparator:
+                 state = "read normal"
+                 current = "".join(current)
+@@ -1675,9 +1681,10 @@
                  else:
                      current.append(char)
              else:

Modified: CalendarServer/trunk/lib-patches/vobject/vobject.vcard.patch
===================================================================
--- CalendarServer/trunk/lib-patches/vobject/vobject.vcard.patch	2011-01-03 20:13:25 UTC (rev 6712)
+++ CalendarServer/trunk/lib-patches/vobject/vobject.vcard.patch	2011-01-03 20:14:59 UTC (rev 6713)
@@ -21,7 +21,7 @@
 -    return [toListOrString(i) for i in
 -            stringToTextValues(string, listSeparator=';', charList=';')]
 +    return [(toListOrString(i) if maybeList else i) for i in
-+            stringToTextValues(string, listSeparator=';')]
++            stringToTextValues(string, listSeparator=';', leaveEscapes=maybeList)]
  
  def toList(stringOrList):
      if isinstance(stringOrList, basestring):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110103/2234277f/attachment-0001.html>


More information about the calendarserver-changes mailing list