From cdevienne at gmail.com Thu Jul 3 18:40:39 2008 From: cdevienne at gmail.com (Christophe de VIENNE) Date: Thu, 3 Jul 2008 18:40:39 +0200 Subject: [icalendar-dev] Problem using unicode vText in parameters. Message-ID: <57b32ba80807030940t706726fp635b175987701b2f@mail.gmail.com> Hi, The following does not work : #vim: encoding=utf8 from icalendar import vText, Parameters p = Parameters() p['TEST'] = vText(u'?') print str(p) I get this error : Traceback (most recent call last): File "bug.py", line 6, in print str(p) UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 5: Am I misusing something ? If not, the following patch fix my issue (and add a test) : Index: src/icalendar/parser.py =================================================================== --- src/icalendar/parser.py (r?vision 56260) +++ src/icalendar/parser.py (copie de travail) @@ -58,10 +58,13 @@ '"Rasmussen, Max"' >>> dQuote('name:value') '"name:value"' + >>> from icalendar import vText + >>> dQuote(vText(u'?ric')) + '\\xc3\\x89ric' """ if QUOTABLE.search(val): return '"%s"' % val - return val + return str(val) # parsing helper def q_split(st, sep=','): Regards, Christophe From regebro at gmail.com Fri Jul 11 20:13:15 2008 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 11 Jul 2008 20:13:15 +0200 Subject: [icalendar-dev] icalendar 2.0 released. Message-ID: <319e029f0807111113x6c4cf454n1eb495403bcda804@mail.gmail.com> The single known actual bug was fixed! I've uploaded it to PyPi, but not to the codespeak homepage, as I have completely forgotten how to update it, and it's going to take me half a day just to figure it out... :-/ Here is the full change log: iCalendar 2.0 (2008-07-11) ========================== API Changes: * EXDATE and RDATE now returns a vDDDLists object, which contains a list of vDDDTypes objects. This is do that EXDATE and RDATE can contain lists of dates, as per RFC. ***Note!***: This change is incompatible with earlier behavior, so if you handle EXDATE and RDATE you will need to update your code. * When createing a vDuration of -5 hours (which in itself is nonsensical), the ical output of that was -P1DT19H, which is correct, but ugly. Now it's '-PT5H', which is prettier. * Made the tests run under Python 2.5+ -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 From regebro at gmail.com Fri Jul 11 22:01:10 2008 From: regebro at gmail.com (Lennart Regebro) Date: Fri, 11 Jul 2008 22:01:10 +0200 Subject: [icalendar-dev] icalendar 2.0 released. In-Reply-To: <319e029f0807111113x6c4cf454n1eb495403bcda804@mail.gmail.com> References: <319e029f0807111113x6c4cf454n1eb495403bcda804@mail.gmail.com> Message-ID: <319e029f0807111301o26499f8epce2ec6b982125b70@mail.gmail.com> I fact, I had missed a bug report, so now I have fixed another bug and released 2.0.1. * Renamed the UTC class to Utc, so it would not clash with the UTC object, since that rendered the UTC object unpicklable. On Fri, Jul 11, 2008 at 20:13, Lennart Regebro wrote: > The single known actual bug was fixed! I've uploaded it to PyPi, but > not to the codespeak homepage, as I have completely forgotten how to > update it, and it's going to take me half a day just to figure it > out... :-/ > > Here is the full change log: > > iCalendar 2.0 (2008-07-11) > ========================== > > API Changes: > > * EXDATE and RDATE now returns a vDDDLists object, which contains a list > of vDDDTypes objects. This is do that EXDATE and RDATE can contain > lists of dates, as per RFC. > > ***Note!***: This change is incompatible with earlier behavior, so if you > handle EXDATE and RDATE you will need to update your code. > > * When createing a vDuration of -5 hours (which in itself is nonsensical), > the ical output of that was -P1DT19H, which is correct, but ugly. Now > it's '-PT5H', which is prettier. > > * Made the tests run under Python 2.5+ > > -- > Lennart Regebro: Zope and Plone consulting. > http://www.colliberty.com/ > +33 661 58 14 64 > -- Lennart Regebro: Zope and Plone consulting. http://www.colliberty.com/ +33 661 58 14 64 From mmacnair at gmail.com Sun Jul 20 18:53:17 2008 From: mmacnair at gmail.com (Michael Macnair) Date: Sun, 20 Jul 2008 17:53:17 +0100 Subject: [icalendar-dev] Deleting events Message-ID: Hello, Does the library offer the ability to delete events from a calendar? >From what I can see it looks like I could mess around with the subcomponents list, but that would be, well, messy. Or I could walk the calendar, creating a new calendar but filtering out the event I don't want ... wildly inefficient for large calendars. Are there any better ways? Thanks, Michael From gene.cash at gmail.com Sun Jul 20 19:29:50 2008 From: gene.cash at gmail.com (Gene Cash) Date: Sun, 20 Jul 2008 13:29:50 -0400 Subject: [icalendar-dev] Deleting events In-Reply-To: References: Message-ID: <4883760E.5080206@gmail.com> Michael Macnair wrote: > Does the library offer the ability to delete events from a calendar? >>From what I can see it looks like I could mess around with the > subcomponents list, but that would be, well, messy. Why is that messy? It's just a simple list. You delete the item from it, and you're done. That's how I do it in my Nokia N800 calendar. And hey, the sigmonster randomly picked a calendar-related quote... -gc -- No one's Unix-like implementations were adequately tested in 1900, when they would have incorrectly identified the year as a leap year. -- Peter Seebach From mmacnair at gmail.com Sun Jul 20 20:45:01 2008 From: mmacnair at gmail.com (Michael Macnair) Date: Sun, 20 Jul 2008 19:45:01 +0100 Subject: [icalendar-dev] Deleting events In-Reply-To: <4883760E.5080206@gmail.com> References: <4883760E.5080206@gmail.com> Message-ID: 2008/7/20 Gene Cash : > Michael Macnair wrote: > >> Does the library offer the ability to delete events from a calendar? >>> >>> From what I can see it looks like I could mess around with the >> >> subcomponents list, but that would be, well, messy. > > Why is that messy? It's just a simple list. You delete the item from it, and > you're done. That's how I do it in my Nokia N800 calendar. I was concerned about subcomponents of subcomponents; finding the event I want to delete; breaking any invariants the library holds; and breaking conformance. However if this is the approved method then I'll just do it! Thanks, Michael