From ferry.boender at gmail.com Mon May 12 18:25:15 2008 From: ferry.boender at gmail.com (Ferry Boender) Date: Mon, 12 May 2008 18:25:15 +0200 Subject: [icalendar-dev] Bug in vDuration? Message-ID: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> Hi All, (I wonder if this list is still active, but we'll see). Either I don't fully understand how vDuration should work, or there is a bug (or rather a shortcoming) in it. When loading a iCalendar file created by KOrganizer, the alarms are mutilated. Here's an short example of what is happening which I think isn't correct: >>> vDuration(timedelta(days=-1)).ical() # Correct '-P1D' >>> vDuration(timedelta(days=1, hours=5)).ical() # Correct 'P1DT5H' >>> vDuration(timedelta(hours=-5)).ical() # Incorrect? '-P1DT19H' I would have expected this to render as '-PT15H', which is the way how KOrganizer marshals negative time offsets for alarms. So now, when I load a iCal file generated by KOrganizer and write it back again, all the alarms are FUBAR. It would appear (from the test-cases mentioned in the docstring of the vDuration ical() method) the original author of the package failed to notice that converting anything other than negative days fails. (or I'm just not getting how this should be used ;-) ) I've written a patch to correct the problem, in case anybody is interested. With the patch (see attachment, if the lists supports them. Otherwise I'll repost), the marshalling is as follows: >>> from icalendar import vDuration >>> from datetime import timedelta >>> vDuration(timedelta(days=1, hours=5)).ical() 'P1DT5H' >>> vDuration(timedelta(hours=-5)).ical() '-PT5H' >>> vDuration(timedelta(days=-10, hours=-5, minutes=-40)).ical() '-P10DT5H40M' All the old testcases still work correctly after applying the patch. (PS: I haven't looked at the iCalendar standard to see if the current way iCalendar python module's marshalling to iCal text is correct and KOrganizer is at fault here). Grtz, Ferry -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/icalendar-dev/attachments/20080512/505f60d4/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: icalendar.patch Type: text/x-patch Size: 1373 bytes Desc: not available Url : http://codespeak.net/pipermail/icalendar-dev/attachments/20080512/505f60d4/attachment-0001.bin From gene.cash at gmail.com Tue May 13 01:59:19 2008 From: gene.cash at gmail.com (Gene Cash) Date: Mon, 12 May 2008 19:59:19 -0400 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> Message-ID: <4828D9D7.7010006@cfl.rr.com> Ferry Boender wrote: > Hi All, > > (I wonder if this list is still active, but we'll see). > > Either I don't fully understand how vDuration should work, or there is a > bug (or rather a shortcoming) in it. When loading a iCalendar file > created by KOrganizer, the alarms are mutilated. Here's an short example > of what is happening which I think isn't correct: > > >>> vDuration(timedelta(days=-1)).ical() # Correct > '-P1D' > >>> vDuration(timedelta(days=1, hours=5)).ical() # Correct > 'P1DT5H' > >>> vDuration(timedelta(hours=-5)).ical() # Incorrect? > '-P1DT19H' > > I would have expected this to render as '-PT15H', which is the way how > KOrganizer marshals negative time offsets for alarms. So now, when I > load a iCal file generated by KOrganizer and write it back again, all > the alarms are FUBAR. It would appear (from the test-cases mentioned in > the docstring of the vDuration ical() method) the original author of the > package failed to notice that converting anything other than negative > days fails. (or I'm just not getting how this should be used ;-) ) > > I've written a patch to correct the problem, in case anybody is > interested. With the patch (see attachment, if the lists supports them. > Otherwise I'll repost), the marshalling is as follows: Actually, I discovered this a while ago. I added just one line and I think it solved the problem, at least for me. Am I wrong here? I'm using this package as part of a time organizer for my Nokia N800. http://home.cfl.rr.com/genecash/nokia/ I posted it but I never got any sort of response. This isn't a full patch, just pointing out the line I added. def ical(self): sign = "" if self.td.days < 0: sign = "-" + self.td = -self.td timepart = "" if self.td.seconds: timepart = "T" hours = self.td.seconds // 3600 minutes = self.td.seconds % 3600 // 60 seconds = self.td.seconds % 60 if hours: timepart += "%dH" % hours if minutes or (hours and seconds): timepart += "%dM" % minutes if seconds: timepart += "%dS" % seconds if self.td.days == 0 and timepart: return "%sP%s" % (sign, timepart) else: return "%sP%dD%s" % (sign, abs(self.td.days), timepart) -gc -- Fig Newton: The force required to accelerate a fig 39.37 inches/sec. From ferry.boender at gmail.com Tue May 13 09:37:42 2008 From: ferry.boender at gmail.com (Ferry Boender) Date: Tue, 13 May 2008 09:37:42 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <4828D876.6090407@cfl.rr.com> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> <4828D876.6090407@cfl.rr.com> Message-ID: <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> On Tue, May 13, 2008 at 1:53 AM, Gene Cash wrote: > > Ferry Boender wrote: > > > > > Either I don't fully understand how vDuration should work, or there is a bug (or rather a shortcoming) in it. When loading a iCalendar file created by KOrganizer, the alarms are mutilated. Here's an short example of what is happening which I think isn't correct: > > > > > > Actually, I discovered this a while ago. I added just one line and I think it solved the problem, at least for me. Am I wrong here? No, I think you're correct. You solution is cleaner. > I posted it but I never got any sort of response. Hm. Too bad the package isn't being maintained anymore. Perhaps somebody should set up a fork somewhere? Is there anybody on the list here who knows about any other bugs which haven't been resolved in the official version? From benno.luthiger at id.ethz.ch Tue May 13 09:52:19 2008 From: benno.luthiger at id.ethz.ch (Luthiger Stoll Benno) Date: Tue, 13 May 2008 09:52:19 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com><4828D876.6090407@cfl.rr.com> <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> Message-ID: Hello I've found out an error in the treatment of EXDATE (see http://codespeak.net/pipermail/icalendar-dev/2007-November/000089.html) and fixed that. However, the patch I've sent hasn't been integrated so far. Martijn Fassen, which acted once as project janitor, strongly argues against forking the project (or at least he did last year). The codespeak people then gave me committer rights to the project repository but that never worked for me so I've never been able to integrate my bug fix myself. I'm still interested to see this bug fixed in the official iCalendar version. Regards, Benno ______________________________________ ETH Zurich Benno Luthiger IT Services WEP J 14, Weinbergstrasse 109 8092 Zurich, Switzerland Tel: +41 44 632 57 65 ______________________________________ -----Original Message----- From: icalendar-dev-bounces at codespeak.net [mailto:icalendar-dev-bounces at codespeak.net] On Behalf Of Ferry Boender Sent: Dienstag, 13. Mai 2008 09:38 To: Gene Cash Cc: icalendar-dev at codespeak.net Subject: Re: [icalendar-dev] Bug in vDuration? On Tue, May 13, 2008 at 1:53 AM, Gene Cash wrote: > > Ferry Boender wrote: > > > > > Either I don't fully understand how vDuration should work, or there is a bug (or rather a shortcoming) in it. When loading a iCalendar file created by KOrganizer, the alarms are mutilated. Here's an short example of what is happening which I think isn't correct: > > > > > > Actually, I discovered this a while ago. I added just one line and I think it solved the problem, at least for me. Am I wrong here? No, I think you're correct. You solution is cleaner. > I posted it but I never got any sort of response. Hm. Too bad the package isn't being maintained anymore. Perhaps somebody should set up a fork somewhere? Is there anybody on the list here who knows about any other bugs which haven't been resolved in the official version? _______________________________________________ icalendar-dev mailing list icalendar-dev at codespeak.net http://codespeak.net/mailman/listinfo/icalendar-dev From maxm at mxm.dk Tue May 13 10:04:23 2008 From: maxm at mxm.dk (Max M) Date: Tue, 13 May 2008 10:04:23 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> <4828D876.6090407@cfl.rr.com> <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> Message-ID: <48294B87.30000@mxm.dk> Ferry Boender skrev: > On Tue, May 13, 2008 at 1:53 AM, Gene Cash wrote: >> Ferry Boender wrote: >> >>> Either I don't fully understand how vDuration should work, or there is a bug (or rather a shortcoming) in it. When loading a iCalendar file created by KOrganizer, the alarms are mutilated. Here's an short example of what is happening which I think isn't correct: >>> >>> >> Actually, I discovered this a while ago. I added just one line and I think it solved the problem, at least for me. Am I wrong here? > > No, I think you're correct. You solution is cleaner. > >> I posted it but I never got any sort of response. > > Hm. Too bad the package isn't being maintained anymore. Perhaps > somebody should set up a fork somewhere? Is there anybody on the list > here who knows about any other bugs which haven't been resolved in the > official version? Yeah. It is one of my dark spots on my conscience. I wrote it, and still have a small itch to make a few changes. I just haven't worked with calendars for the last few years, so it always seem to get bumped to the end of the todo list. It would be a good idea to either give access to more people or to move it to a somewhat more open environment, so that there could be more maintainers. Maintaining the code is more motivating when you actually use it :-s -- 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 ferry.boender at gmail.com Tue May 13 10:06:52 2008 From: ferry.boender at gmail.com (Ferry Boender) Date: Tue, 13 May 2008 10:06:52 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> <4828D876.6090407@cfl.rr.com> <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> Message-ID: <57ea1ef80805130106i3b3c324geb87b90692cc93f1@mail.gmail.com> On Tue, May 13, 2008 at 9:52 AM, Luthiger Stoll Benno wrote: > Hello > > I've found out an error in the treatment of EXDATE (see > http://codespeak.net/pipermail/icalendar-dev/2007-November/000089.html) > and fixed that. However, the patch I've sent hasn't been integrated so > far. > > Martijn Fassen, which acted once as project janitor, strongly argues > against forking the project (or at least he did last year). The > codespeak people then gave me committer rights to the project repository > but that never worked for me so I've never been able to integrate my bug > fix myself. I'm strongly against forking the project too, unless there's a major conflict of interest (which there doesn't appear to be in this case). We just need a way for someone to release updates for the project. Any idea on why you couldn't access the repository? > > I'm still interested to see this bug fixed in the official iCalendar > version. > > Regards, > Benno From ferry.boender at gmail.com Tue May 13 10:21:04 2008 From: ferry.boender at gmail.com (Ferry Boender) Date: Tue, 13 May 2008 10:21:04 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <48294B87.30000@mxm.dk> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> <4828D876.6090407@cfl.rr.com> <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> <48294B87.30000@mxm.dk> Message-ID: <57ea1ef80805130121v229eb9feodbafc23b470b30c1@mail.gmail.com> On Tue, May 13, 2008 at 10:04 AM, Max M wrote: > Yeah. It is one of my dark spots on my conscience. I wrote it, and still > have a small itch to make a few changes. > > I just haven't worked with calendars for the last few years, so it always > seem to get bumped to the end of the todo list. No worries. :-) At least you're still around. Some authors just seem to disappear from the face of the earth sometimes ;-) > > It would be a good idea to either give access to more people or to move it > to a somewhat more open environment, so that there could be more > maintainers. I'd be willing to do some janitor work on it, at least for bringing the package up-to-date. I don't know too much about the iCalendar standard - just enough to use it - but I guess it's mostly bug fixing and other asorted maintainance work from now on. But I don't think I'll have the time to actually do support on it though; it'd just be applying patches and releasing new versions. Maybe release an egg version of it and upload it to the Python Package Index. Let me know what you think. > > Maintaining the code is more motivating when you actually use it :-s > Ain't that the truth :-) From benno.luthiger at id.ethz.ch Tue May 13 10:31:55 2008 From: benno.luthiger at id.ethz.ch (Luthiger Stoll Benno) Date: Tue, 13 May 2008 10:31:55 +0200 Subject: [icalendar-dev] Bug in vDuration? In-Reply-To: <57ea1ef80805130106i3b3c324geb87b90692cc93f1@mail.gmail.com> References: <57ea1ef80805120925q4d24fa4sb7aeff0ad9dee068@mail.gmail.com> <4828D876.6090407@cfl.rr.com> <57ea1ef80805130037s36729dfbv6f671a8a1dbcf9d5@mail.gmail.com> <57ea1ef80805130106i3b3c324geb87b90692cc93f1@mail.gmail.com> Message-ID: Dear Ferry There seems to be a misconfiguration on the side of the svn repository hosted by codespeak: I'm able to login to the codespeak server but when I try to commit code, the svn server doesn't accept by login. Regards, Benno -----Original Message----- From: Ferry Boender [mailto:ferry.boender at gmail.com] Sent: Dienstag, 13. Mai 2008 10:07 To: Luthiger Stoll Benno Cc: icalendar-dev at codespeak.net Subject: Re: [icalendar-dev] Bug in vDuration? On Tue, May 13, 2008 at 9:52 AM, Luthiger Stoll Benno wrote: > Hello > > I've found out an error in the treatment of EXDATE (see > http://codespeak.net/pipermail/icalendar-dev/2007-November/000089.html) > and fixed that. However, the patch I've sent hasn't been integrated so > far. > > Martijn Fassen, which acted once as project janitor, strongly argues > against forking the project (or at least he did last year). The > codespeak people then gave me committer rights to the project repository > but that never worked for me so I've never been able to integrate my bug > fix myself. I'm strongly against forking the project too, unless there's a major conflict of interest (which there doesn't appear to be in this case). We just need a way for someone to release updates for the project. Any idea on why you couldn't access the repository? > > I'm still interested to see this bug fixed in the official iCalendar > version. > > Regards, > Benno From stephenemslie at gmail.com Fri May 16 00:54:52 2008 From: stephenemslie at gmail.com (stephen emslie) Date: Thu, 15 May 2008 23:54:52 +0100 Subject: [icalendar-dev] synchronizing calendars with rfc2446? Message-ID: <51f97e530805151554y17c9d59due2b69f4eb4cde52c@mail.gmail.com> I've just started playing around with icalendar, so excuse me if this is an obvious question, but does this library support the notion of synchronizing events via iTIP (rfc 2446) in any way? Thanks Stephen Emslie