collective/icalendar — pull request #154 by geier (2014-12-07 22:53:40+00:00)
Title: [WIP] creating timezones from VTIMEZONE components

I'd like to run this by you before it is ready, so everybody can voice their conceptual problems with this approach early. Once this is ready it should close #44.

TZIDs known to the TZDB, are left alone and data from the TZDB is used as before. Every TZ is only created once and registered in a global timezone dict.

Some caveats:
* we are currently relying (especially the tests) on pytz internals
* this only works when VTIMEZONE components come before DATE-TIME components that make use of them (while this seems to be the standard way to generate icalendars, there is no word about this in the RFC). To circumvent this, we would probably need some architectural changes, like two rounds of parsing.
* tz creation feels a bit brute-forced into cal.py, but there are so many exceptions in from_ical() already, that I don't feel too guilty about introducing one more.

TODO
--------

* [ ] check for the edge case of DST moving an event over the date line
* [ ] more tests