kopia lustrzana https://github.com/collective/icalendar
Fix handling of non-unique VTIMEZONEs.
We should probably choose a better system for generating unique TZNAMEs.pull/228/head
rodzic
2e8311ba0a
commit
d445fcf87c
|
@ -17,6 +17,11 @@ Bug fixes:
|
|||
- added an assertion that VTIMEZONE sub-components' DTSTART must be of type
|
||||
DATETIME [geier]
|
||||
|
||||
- Fix handling of VTIMEZONEs with subcomponents with the same DTSTARTs and
|
||||
OFFSETs but which are of different types [geier]
|
||||
|
||||
- *add item here*
|
||||
|
||||
|
||||
3.11.4 (2017-05-10)
|
||||
-------------------
|
||||
|
|
|
@ -572,6 +572,7 @@ class Timezone(Component):
|
|||
zone = str(self['TZID'])
|
||||
transitions = []
|
||||
dst = {}
|
||||
tznames = set()
|
||||
for component in self.walk():
|
||||
if type(component) == Timezone:
|
||||
continue
|
||||
|
@ -587,6 +588,11 @@ class Timezone(Component):
|
|||
component['TZOFFSETFROM'].to_ical(), # for whatever reason this is str/unicode
|
||||
component['TZOFFSETTO'].to_ical(), # for whatever reason this is str/unicode
|
||||
)
|
||||
# TODO better way of making sure tznames are unique
|
||||
while tzname in tznames:
|
||||
tzname += '_1'
|
||||
tznames.add(tzname)
|
||||
|
||||
dst[tzname], component_transitions = self._extract_offsets(
|
||||
component, tzname
|
||||
)
|
||||
|
|
Ładowanie…
Reference in New Issue