From maxm at mxm.dk Mon May 1 13:39:44 2006 From: maxm at mxm.dk (Max M) Date: Mon, 01 May 2006 13:39:44 +0200 Subject: [icalendar-dev] iCalendar cannot parse file In-Reply-To: <4455E5E0.3040309@iue.tuwien.ac.at> References: <4455E5E0.3040309@iue.tuwien.ac.at> Message-ID: <4455F380.6080908@mxm.dk> Markus Gritsch wrote: > Hi, > > I downloaded the iCalendar 0.11 package and tried to use it for > reading an .ics file exported from OpenGroupware. Unfortunately the > parser failed with the following exception: > > Traceback (most recent call last): > File "test.py", line 2, in ? > cal = Calendar.from_string(open('_synedra_mgr.ics','rb').read()) > File "C:\Python24\lib\site-packages\icalendar\cal.py", line 342, > in from_string > name, params, vals = line.parts() > File "C:\Python24\lib\site-packages\icalendar\parser.py", line > 406, in parts > raise ValueError, 'Content line could not be parsed into parts' > ValueError: Content line could not be parsed into parts > > Has someone an idea how to fix the parser? You should fix your data instead. When I print out the keynames I get this: name BEGIN name METHOD name PRODID name VERSION name BEGIN name LOCATION name STATUS name SUMMARY name DESCRIPTION name \n Traceback (most recent call last): File "E:\maxm\pys\x.py", line 6, in ? cal = icalendar.Calendar.from_string(open('x.ics','rb').read()) File "C:\Python24\lib\site-packages\icalendar\cal.py", line 342, in from_string name, params, vals = line.parts() File "C:\Python24\lib\site-packages\icalendar\parser.py", line 398, in parts validate_token(name) File "C:\Python24\lib\site-packages\icalendar\parser.py", line 42, in validate_token raise ValueError, name ValueError: \n This means that the file has a '\n' as a keyname. Which is illegal. Looking into your ics file I can see: DESCRIPTION:Der Termin f?r?s Fahrsicherheitstraining steht jetzt\, ist zwar ein Bissi sp?ter als erwartet\, aber dann daf?r dort sicher schon sehr fr?hlingshaft... \n \nBitte p?nktlich um sp?testens 09:30 auftauchen! Here there is an illegal fold. "a fold is carriage return followed by either a space or a tab" And as you can see, there is no space or tab before the '\n', which is the problem. It fools the parser into thinking it is a key. It should look like this to be legal: DESCRIPTION:Der Termin f?r?s Fahrsicherheitstraining steht jetzt\, ist zwar ein Bissi sp?ter als erwartet\, aber dann daf?r dort sicher schon sehr fr?hlingshaft... \n \nBitte p?nktlich um sp?testens 09:30 auftauchen! Notice the leading space character. or more correctly like: DESCRIPTION:Der Termin f?r?s Fahrsicherheitstraining steht jetzt\, ist zwar ein Bissi sp?ter als erwartet\, aber dann daf?r dort sicher schon sehr fr? hlingshaft...\n\nBitte p?nktlich um sp?testens 09:30 auftauchen! Feel free to post a bug report to OpenGroupware. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 From gritsch at iue.tuwien.ac.at Mon May 1 13:53:04 2006 From: gritsch at iue.tuwien.ac.at (Markus Gritsch) Date: Mon, 01 May 2006 13:53:04 +0200 Subject: [icalendar-dev] iCalendar cannot parse file In-Reply-To: <4455F380.6080908@mxm.dk> References: <4455E5E0.3040309@iue.tuwien.ac.at> <4455F380.6080908@mxm.dk> Message-ID: <4455F6A0.9070502@iue.tuwien.ac.at> Max M wrote: > > You should fix your data instead. > > [...] I see. Thanks for the quick response. I will look what I can do, either on the OpenGroupware front, or fix the exported files myself. Maybe this is also the reason, why my iPod cannot read the file too. However, importing into the Google Calendar worked. I think they cannot afford to be so picky :) Thanks again for the very detaild explanations. Have a nice day, Markus P.S.: Maybe you want to fix you email address in the CREDITS.txt file. There it just reads maxm at mxm.d -- notice the missing 'k' in .dk From gregg at pointillistic.com Tue May 2 17:48:23 2006 From: gregg at pointillistic.com (Gregg Irwin) Date: Tue, 2 May 2006 09:48:23 -0600 Subject: [icalendar-dev] New Member / glitch in example file Message-ID: <103527820953.20060502094823@pointillistic.com> Hello List! I'm new to the list, working on iCal integration for a project. I'm using your test files as test cases for my parser (not using Python for the project, but greatly appreciate the test files :) and found a non-conformant entry in one. The groupscheduled.ics file has this line: ORGANIZER;ROLE=CHAIR:MAILTO:mrbig at host.com But the organizer property shouldn't have a ROLE param, per the spec. HTH! --Gregg Irwin From gregg at pointillistic.com Tue May 2 17:57:00 2006 From: gregg at pointillistic.com (Gregg Irwin) Date: Tue, 2 May 2006 09:57:00 -0600 Subject: [icalendar-dev] General thoughts on strictness Message-ID: <140528338515.20060502095700@pointillistic.com> Hello again, I haven't hit the archives here yet, but is there a general feeling about how strict people are when it comes to the spec or formatting? e.g. the %multiple.ics example file is oddly formatted (I thought blank lines were not conformant as well). I've also found a number of other test files that break rules here and there, which makes writing a parser based on the RFC spec a bit of a chore, since you don't know who is at fault when things fail (the ABNF spec has glitches too). Are there any "reference" feeds that people use to test their parsers? e.g. it seems that Apple's iCal, PHP iCalendar, and the new Google calendar would be top targets for compatibility. Any thoughts are welcome! --Gregg Irwin From maxm at mxm.dk Tue May 2 18:03:11 2006 From: maxm at mxm.dk (Max M) Date: Tue, 02 May 2006 18:03:11 +0200 Subject: [icalendar-dev] New Member / glitch in example file In-Reply-To: <103527820953.20060502094823@pointillistic.com> References: <103527820953.20060502094823@pointillistic.com> Message-ID: <445782BF.7060109@mxm.dk> Gregg Irwin wrote: >Hello List! > >I'm new to the list, working on iCal integration for a project. I'm >using your test files as test cases for my parser (not using Python >for the project, but greatly appreciate the test files :) and found a >non-conformant entry in one. > >The groupscheduled.ics file has this line: > >ORGANIZER;ROLE=CHAIR:MAILTO:mrbig at host.com > >But the organizer property shouldn't have a ROLE param, per the spec. > Just write: ORGANIZER;X-ROLE=CHAIR:MAILTO:mrbig at host.com And the problem is fixed ;-) Acually the parser doesnt check out conformance at such detail. If you choose to be so picky at the parser level you are bound to get bad results. There are a *lot* of malformed files out there. If you can parse them, at least you can look at the result and decide not to use them. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 From maxm at mxm.dk Tue May 2 18:21:16 2006 From: maxm at mxm.dk (Max M) Date: Tue, 02 May 2006 18:21:16 +0200 Subject: [icalendar-dev] General thoughts on strictness In-Reply-To: <140528338515.20060502095700@pointillistic.com> References: <140528338515.20060502095700@pointillistic.com> Message-ID: <445786FC.8040700@mxm.dk> Gregg Irwin wrote: >Hello again, > >I haven't hit the archives here yet, but is there a general feeling >about how strict people are when it comes to the spec or formatting? > > I tried to follow Postel's Prescription: Be generous in what you accept, rigorous in what you emit >e.g. the %multiple.ics example file is oddly formatted (I thought >blank lines were not conformant as well). > Completely blanks lines are not, but you can do some tricks like having lines with only a single space and a \r\n. This will look like three blank lines: '\r\n \r\n \r\n ' but is just legal line folding. Isn't that what you are seing? I didn't write the multiple calendar stuff, so I am not absolutely shure about it. >I've also found a number of >other test files that break rules here and there, which makes writing >a parser based on the RFC spec a bit of a chore, since you don't know >who is at fault when things fail (the ABNF spec has glitches too). > > The glorious life of a standards developer ;-) >Are there any "reference" feeds that people use to test their parsers? >e.g. it seems that Apple's iCal, PHP iCalendar, and the new Google >calendar would be top targets for compatibility. > > You should just find whatever files you can find. Whenever you find an error, test if you are following the spec. If you are, you just tell the producer they have a bug. Then decide if you can make your parser more accepting, or if you should make a workaround, if the producer is important enough. -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science Phone: +45 66 11 84 94 Mobile: +45 29 93 42 96 From gregg at pointillistic.com Tue May 2 18:18:24 2006 From: gregg at pointillistic.com (Gregg Irwin) Date: Tue, 2 May 2006 10:18:24 -0600 Subject: [icalendar-dev] Glitch in %small.ics example file In-Reply-To: <445782BF.7060109@mxm.dk> References: <103527820953.20060502094823@pointillistic.com> <445782BF.7060109@mxm.dk> Message-ID: <160529622453.20060502101824@pointillistic.com> Hello Max, %small.ics contains this: PARTICIPANT;CN=Max M:MAILTO:maxm at mxm.dk Which should probably be this: ATTENDEE;ROLE=REQ-PARTICIPANT;CN=Max M:MAILTO:maxm at mxm.dk HTH! --Gregg From natea at jazkarta.com Fri May 26 19:35:28 2006 From: natea at jazkarta.com (Nate Aune) Date: Fri, 26 May 2006 13:35:28 -0400 Subject: [icalendar-dev] [Google-SoC] Plone Recurring Events 2.0 In-Reply-To: <2418.147.9.41.60.1148496748.squirrel@147.9.41.60> References: <200605241825.k4OIPrpN022163@sb-srv-02.csma.biz> <2418.147.9.41.60.1148496748.squirrel@147.9.41.60> Message-ID: > We have single object recurring events working within the Plone > default portlet calendar and have very little left to complete > before an > alpha release should be ready (hopefully in a week or two at > most). Thus > far we really only have exceptions to the event and a few more > logic bugs > left to work out. I'll be certain to ping the developer board as > we get > closer to an alpha release. you may also want to read Sean Upton's latest "brain dump" about recurrence and complex event calendars in Plone (found via planet.plone.org). http://www.mostscript.com/weblog/?p=30 Sean is responsible for the very advanced website: http:// www.signonsandiego.com/ and is working on an initial public release of code for editorial content management system for newspapers/media built on top of Plone. http://www.mostscript.com/weblog/?p=25 Nate