From hideki at pyramind.com Fri Sep 10 21:42:57 2010 From: hideki at pyramind.com (Hideki Yamashita) Date: Fri, 10 Sep 2010 12:42:57 -0700 Subject: [icalendar-dev] Syntax Error during setup Message-ID: <58E4A574-DA33-437C-A19D-DFD95A529354@pyramind.com> Hi, My name is Deks and I'm trying to reach out in hopes of finding some answers. I'm currently trying to convert caldav to ical using a script I found called merge_ics.py so I can use phpicalendar to embed the converted caldav feed on a webpage. I understand that caldav does not support publishing like ical does so when I found it was possible to convert a caldav calendar to ical using this script, i started having hopes. These hopes were quickly dashed when I attempted to run the script and got this error: DeprecationWarning: object.__init__() takes no parameters It seems that's a bug in Python 2.6, so I found a patch here: http://codespeak.net/pipermail/icalendar-dev/2009-February/000137.html I'm not much of a Python user, but from my scouring of the 'net I'm assuming I need to make a patch file using Diff. I copied the text to a text file for the patch and created a patch file using diff. I patched prop.py using the patch command (diff -u old new > old.patch) then (patch < old.patch) So, after patching, I ran setup.py once again and got this error: byte-compiling build/bdist.macosx-10.6-universal/egg/icalendar/prop.py to prop.pyc SyntaxError: ('invalid syntax', ('build/bdist.macosx-10.6-universal/egg/icalendar/prop.py', 1, 6, 'Index: src/icalendar/prop.py\n')) I'm using Apple Snow Leopard Server to host the caldav server; would this cause issues? Thanks for any info! Deks Hideki Yamashita | IT Manager contact | Hideki at pyramind.com 415-896-9800 | x204 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/icalendar-dev/attachments/20100910/a165054a/attachment.htm From scanny at cisco.com Sat Sep 11 08:13:42 2010 From: scanny at cisco.com (Steve Canny) Date: Fri, 10 Sep 2010 23:13:42 -0700 Subject: [icalendar-dev] Patch for recurrence rule parse failure from CDO Exchange calendar entry Message-ID: <41689BD2-4279-4E03-8262-E62B75B1E703@cisco.com> Hello list, I've found this library very valuable lately, just wanted to submit a patch in hopes of finding a committer: ---- Problem: iCalendar entries with "PRODID:Microsoft CDO for Microsoft Exchange" from time to time throw an error in parsing the recurrence rule. Example Error: "Error in recurrence rule: FREQ=MONTHLY;UNTIL=20110215T210000Z;INTERVAL=1;BYDAY=3 TU;WKST=SU" Analysis: The offending segment in this case is: "BYDAY=3 TU". The parser expects something like "BYDAY=3TU". Fix: Patch line 62 of prop.py from: WEEKDAY_RULE = re.compile('(?P[+-]?)(?P[\d]?)' to: WEEKDAY_RULE = re.compile('(?P[+-]?)(?P[\d]?) ?' Basically, add an optional space between the relative token and the weekday token. ---- Please respond if there is a committer who can commit this change for the next release. Best, Steve From scanny at cisco.com Sat Sep 11 09:28:18 2010 From: scanny at cisco.com (Steve Canny) Date: Sat, 11 Sep 2010 00:28:18 -0700 Subject: [icalendar-dev] Patch for VALARM parse failure Message-ID: <4BF35E44-CDD3-4C4C-BBCC-D8C5115E4F9B@cisco.com> Hello list, Me again, with a second patch that cropped up as I worked on my current project: I've found this library very valuable for my current project and wanted to submit this second patch as well in hopes of finding an active committer/maintainer: If there aren't any, let me know, I might be willing to volunteer :) ---- Problem ======= iCalendar entries with "PRODID:Microsoft CDO for Microsoft Exchange" from time to time throw an error in parsing a VALARM sub-element. Example Error ============= "ValueError: Wrong date format +PT00H00M00S" Offending Element ================= ''' BEGIN:VALARM ACTION:DISPLAY DESCRIPTION:REMINDER TRIGGER;RELATED=START:+PT00H00M00S END:VALARM ''' Analysis ======== icalendar code (and RFC spec) do not expect a '+' (plus sign) to precede durations that are not negative. My guess is that a Microsoft Exchange programmer added some code roughly like "if t < 0: put a '-' at the beginning, else put a '+' at the beginning". Not sure I wouldn't have done the same in a pinch. Anyway, it breaks the library and given the choice between changing the library code and asking Microsoft to come into strict compliance with the RFC spec, I'm thinking a single-line patch is in order. Fix === Patch line 608 of prop.py from: if u.startswith('-P') or u.startswith('P'): to: if u.startswith('-P') or u.startswith('+P') or u.startswith('P'): in vi parlance: 608 s/or/or u.startswith('+P') or/ Basically, add '+P' as an indicator that the next token is a vDuration rather than a vDatetime or vDate. ---- Please respond if there is a committer who can commit this change for the next release, or if there's anything else I can do to move this along. Best, Steve From sappj at ieee.org Mon Sep 13 04:18:24 2010 From: sappj at ieee.org (Joe Sapp) Date: Sun, 12 Sep 2010 22:18:24 -0400 Subject: [icalendar-dev] Patch for VALARM parse failure In-Reply-To: <4BF35E44-CDD3-4C4C-BBCC-D8C5115E4F9B@cisco.com> References: <4BF35E44-CDD3-4C4C-BBCC-D8C5115E4F9B@cisco.com> Message-ID: <4C8D89F0.80804@ieee.org> On 09/11/2010 03:28 AM, Steve Canny wrote: > Please respond if there is a committer who can commit this change for the > next release, or if there's anything else I can do to move this along. I think it'd be most useful for the maintainers and the community if you could post two separate patches for each of your fixes against the latest release (version 2.1). Joe From sappj at ieee.org Mon Sep 13 04:17:05 2010 From: sappj at ieee.org (Joe Sapp) Date: Sun, 12 Sep 2010 22:17:05 -0400 Subject: [icalendar-dev] Syntax Error during setup In-Reply-To: <58E4A574-DA33-437C-A19D-DFD95A529354@pyramind.com> References: <58E4A574-DA33-437C-A19D-DFD95A529354@pyramind.com> Message-ID: <4C8D89A1.9020006@ieee.org> Hi, On 09/10/2010 03:42 PM, Hideki Yamashita wrote: > Hi, > > My name is Deks and I'm trying to reach out in hopes of finding some > answers. I'm currently trying to convert caldav to ical using a script I > found called merge_ics.py so I can use phpicalendar to embed the converted > caldav feed on a webpage. I understand that caldav does not support > publishing like ical does so when I found it was possible to convert a > caldav calendar to ical using this script, i started having hopes. CalDAV stores files in icalendar format. As far as I can tell, it's basically WebDAV storing icalendar files. When you say 'ical', do you mean Apples iCal program or icalendar files? > These hopes were quickly dashed when I attempted to run the script and got > this error: > > DeprecationWarning: object.__init__() takes no parameters > > It seems that's a bug in Python 2.6, so I found a patch > here: http://codespeak.net/pipermail/icalendar-dev/2009-February/000137.html > > I'm not much of a Python user, but from my scouring of the 'net I'm assuming > I need to make a patch file using Diff. I copied the text to a text file > for the patch and created a patch file using diff. I patched prop.py using > the patch command (diff -u old new > old.patch) then (patch < old.patch) This might be an old patch. Do you have version 2.1? And patching consists of downloading those patches to the proper directory (the one containing src/icalendar/prop.py, for example) then executing `patch -p0 < prop.py.diff`, for example. You shouldn't need to run diff... > So, after patching, I ran setup.py once again and got this error: > > byte-compiling build/bdist.macosx-10.6-universal/egg/icalendar/prop.py to > prop.pyc > SyntaxError: ('invalid syntax', > ('build/bdist.macosx-10.6-universal/egg/icalendar/prop.py', 1, 6, 'Index: > src/icalendar/prop.py\n')) See if properly patching prop.py fixes that. HTH, Joe From scanny at cisco.com Mon Sep 13 06:10:31 2010 From: scanny at cisco.com (Steve Canny) Date: Sun, 12 Sep 2010 21:10:31 -0700 Subject: [icalendar-dev] Patch for VALARM parse failure In-Reply-To: <4BF35E44-CDD3-4C4C-BBCC-D8C5115E4F9B@cisco.com> References: <4BF35E44-CDD3-4C4C-BBCC-D8C5115E4F9B@cisco.com> Message-ID: <62294C2E-9340-4EAA-ADFF-00CF8192E6EC@cisco.com> Thanks for the pointer Joe, apologies for my newbieness with regard to open source working practices. Hoping to learn so I can be of more help going forward. Not sure if it's handier to provide the patch inline or as an attachment so I'll do both (any guidance or pointers where to learn gratefully received :) Problem restated here for convenience: ================ Problem: iCalendar entries with "PRODID:Microsoft CDO for Microsoft Exchange" from time to time throw an error in parsing a VALARM sub-element. Example Error: "ValueError: Wrong date format +PT00H00M00S" Offending Element: ''' BEGIN:VALARM ACTION:DISPLAY DESCRIPTION:REMINDER TRIGGER;RELATED=START:+PT00H00M00S END:VALARM ''' Analysis: icalendar code (and RFC spec) do not expect a '+' (plus sign) to precede durations that are not negative. Fix: Add '+P' as indicator that token is a vDuration rather than a vDatetime or vDate. Patch: also attached as svn-diff-out.txt ~~~~~~~~~ Index: src/icalendar/prop.py =================================================================== --- src/icalendar/prop.py (revision 77031) +++ src/icalendar/prop.py (working copy) @@ -605,7 +605,7 @@ def from_ical(ical): "Parses the data format from ical text format" u = ical.upper() - if u.startswith('-P') or u.startswith('P'): + if u.startswith('-P') or u.startswith('+P') or u.startswith('P'): return vDuration.from_ical(ical) try: return vDatetime.from_ical(ical) ~~~~~~~~~ I assumed svn diff was the most convenient form, please let me know if something else would make it easier. Best, Steve On Sep 12, 2010, at 7:18 PM, Joe Sapp wrote: > On 09/11/2010 03:28 AM, Steve Canny wrote: >> Please respond if there is a committer who can commit this change for the >> next release, or if there's anything else I can do to move this along. > > I think it'd be most useful for the maintainers and the community if you > could post two separate patches for each of your fixes against the latest > release (version 2.1). > > Joe -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: svn-diff-out.txt Url: http://codespeak.net/pipermail/icalendar-dev/attachments/20100912/a58c41db/attachment.txt From scanny at cisco.com Mon Sep 13 06:13:22 2010 From: scanny at cisco.com (Steve Canny) Date: Sun, 12 Sep 2010 21:13:22 -0700 Subject: [icalendar-dev] Patch for recurrence rule parse failure from CDO Exchange calendar entry In-Reply-To: <41689BD2-4279-4E03-8262-E62B75B1E703@cisco.com> References: <41689BD2-4279-4E03-8262-E62B75B1E703@cisco.com> Message-ID: <1BDC86F4-A9BC-4123-97FC-BFFF38768FFD@cisco.com> Resubmitting with patch file: ================ Problem: iCalendar entries with "PRODID:Microsoft CDO for Microsoft Exchange" from time to time throw an error in parsing the recurrence rule. Example Error: "Error in recurrence rule: FREQ=MONTHLY;UNTIL=20110215T210000Z;INTERVAL=1;BYDAY=3 TU;WKST=SU" Analysis: The offending segment in this case is: "BYDAY=3 TU". The parser expects something like "BYDAY=3TU". Fix: Add an optional space between the relative token and the weekday token in the WEEKDAY_RULE regexp delared on line 62 of src/icalendar/prop.py Patch: Also attached as svn-diff-out.txt ~~~~~~~~~ Index: src/icalendar/prop.py =================================================================== --- src/icalendar/prop.py (revision 77031) +++ src/icalendar/prop.py (working copy) @@ -59,7 +59,7 @@ WEEKS_PART = r'(\d+)W' DURATION_REGEX = re.compile(r'([-+]?)P(?:%s|%s)$' % (WEEKS_PART, DATETIME_PART)) -WEEKDAY_RULE = re.compile('(?P[+-]?)(?P[\d]?)' +WEEKDAY_RULE = re.compile('(?P[+-]?)(?P[\d]?) ?' '(?P[\w]{2})$') class vBinary: ~~~~~~~~~ Best, Steve -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: svn-diff-out.txt Url: http://codespeak.net/pipermail/icalendar-dev/attachments/20100912/74576156/attachment.txt