[icalendar-dev] util.py/tools.py uid patches

Alan Milligan alan at balclutha.org
Fri Dec 30 07:44:42 CET 2005


Hi,

I've just been making some efforts to port PloneiCalendar to this
python-icalendar library (as available at
https://linux.last-bastion.net/RPC2/up2date/plope/item949227908).

I've attached some patches for some changes to the uid generation which
was quite broken.

To tell you the truth, I think I'll probably port this to using the
uuidgen utility that comes with e2fsprogs as we don't really care about
non-unix server environments and this is a fairly industry-strength
implementation.

Something else I have noted in this port is the non-transparency in
doing datetime arithmetic :(  Specifically, datetime.date objects (or
rather vDDDatetime objects with underlying datetime.date
representations) are created quite readily but these do not allow
timedelta creations when applied to datetime.datetime instances (ie
TypeError when doing datetime.date - datetime.datetime).

While one could argue that there should be methods available within
datetime.date and datetime.time to promote these to datetime.datetime
instances, but I'm having to do some ugly conversions in places.

Similarly, the vDatetime stuff could also support these __add__ and
__sub__ features to behave as full first-class citizens (a __len__
function would also help in this regard).  Any thoughts on getting these
into the next release??

Alan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iCalendar-uuidgen.patch
Type: text/x-patch
Size: 1563 bytes
Desc: not available
Url : http://codespeak.net/pipermail/icalendar-dev/attachments/20051230/c4b2ea2b/attachment.bin 


More information about the icalendar-dev mailing list