[Zope-Checkins] Re: [Checkins] SVN: Zope/trunk/lib/python/DateTime/
tidy up legacy time zones
Laurence Rowe
l at lrowe.co.uk
Tue Oct 23 08:51:13 EDT 2007
whoops, send as subscribed email address.
On 23/10/2007, Laurence Rowe <laurence at lrowe.co.uk> wrote:
> There was no data for it. Trying to retrieve it from the _tzinfo cache
> resulted in a KeyError, it's not in pytz.common_timezones or the
> _zmap.
>
> 'America/Noronha' is not in pytz.common_timezones either.
>
> Laurence
>
> On 23/10/2007, Sidnei da Silva <sidnei at enfoldsystems.com> wrote:
> > May I ask why the 'Brazil/DeNoronha' timezone was commented out?
> > AFAICT, it's a valid timezone. At least I can find several references,
> > one of which seems to imply that 'Brazil/DeNoronha' is an alias to
> > 'America/Noronha'.
> >
> > http://www.tldp.org/HOWTO/TimePrecision-HOWTO/tz.html
> > http://dev.joyent.com/projects/connector/browse/trunk/vendor/gems/tzinfo-0.3.4/lib/tzinfo/definitions/Brazil/DeNoronha.rb?rev=414
> >
> > On 10/23/07, Laurence Rowe <l at lrowe.co.uk> wrote:
> > > Log message for revision 80958:
> > > tidy up legacy time zones
> > >
> > > Changed:
> > > U Zope/trunk/lib/python/DateTime/DateTime.py
> > > U Zope/trunk/lib/python/DateTime/tests/testDateTime.py
> > >
> > > -=-
> > > Modified: Zope/trunk/lib/python/DateTime/DateTime.py
> > > ===================================================================
> > > --- Zope/trunk/lib/python/DateTime/DateTime.py 2007-10-23 11:32:45 UTC (rev 80957)
> > > +++ Zope/trunk/lib/python/DateTime/DateTime.py 2007-10-23 11:47:27 UTC (rev 80958)
> > > @@ -150,7 +150,7 @@
> > >
> > > class _cache:
> > >
> > > - _zlst=['Brazil/Acre','Brazil/DeNoronha','Brazil/East',
> > > + _zlst=['Brazil/Acre','Brazil/East', #'Brazil/DeNoronha',
> > > 'Brazil/West','Canada/Atlantic','Canada/Central',
> > > 'Canada/Eastern','Canada/East-Saskatchewan',
> > > 'Canada/Mountain','Canada/Newfoundland',
> > > @@ -184,17 +184,17 @@
> > > 'MEWT','SWT','FWT','EET','EEST','BT','ZP4','ZP5','ZP6',
> > > 'WAST','CCT','JST','EAST','GST','NZT','NZST','IDLE']
> > >
> > > - _zmap={'aest':'GMT+1000', 'aedt':'GMT+1100',
> > > - 'aus eastern standard time':'GMT+1000',
> > > - 'sydney standard time':'GMT+1000',
> > > - 'tasmania standard time':'GMT+1000',
> > > - 'e. australia standard time':'GMT+1000',
> > > + _zmap={'aest':'GMT+10', 'aedt':'GMT+11',
> > > + 'aus eastern standard time':'GMT+10',
> > > + 'sydney standard time':'GMT+10',
> > > + 'tasmania standard time':'GMT+10',
> > > + 'e. australia standard time':'GMT+10',
> > > 'aus central standard time':'GMT+0930',
> > > 'cen. australia standard time':'GMT+0930',
> > > - 'w. australia standard time':'GMT+0800',
> > > + 'w. australia standard time':'GMT+8',
> > >
> > > 'brazil/acre':'Brazil/Acre',
> > > - 'brazil/denoronha':'Brazil/Denoronha',
> > > + #'brazil/denoronha':'Brazil/Denoronha',
> > > 'brazil/east':'Brazil/East','brazil/west':'Brazil/West',
> > > 'canada/atlantic':'Canada/Atlantic',
> > > 'canada/central':'Canada/Central',
> > > @@ -203,7 +203,7 @@
> > > 'canada/mountain':'Canada/Mountain',
> > > 'canada/newfoundland':'Canada/Newfoundland',
> > > 'canada/pacific':'Canada/Pacific','canada/yukon':'Canada/Yukon',
> > > - 'central europe standard time':'GMT+0100',
> > > + 'central europe standard time':'GMT+1',
> > > 'chile/continental':'Chile/Continental',
> > > 'chile/easterisland':'Chile/EasterIsland',
> > > 'cst':'US/Central','cuba':'Cuba','est':'US/Eastern','egypt':'Egypt',
> > >
> > > Modified: Zope/trunk/lib/python/DateTime/tests/testDateTime.py
> > > ===================================================================
> > > --- Zope/trunk/lib/python/DateTime/tests/testDateTime.py 2007-10-23 11:32:45 UTC (rev 80957)
> > > +++ Zope/trunk/lib/python/DateTime/tests/testDateTime.py 2007-10-23 11:47:27 UTC (rev 80958)
> > > @@ -17,7 +17,7 @@
> > > import time
> > > import unittest
> > >
> > > -from DateTime.DateTime import _findLocalTimeZoneName
> > > +from DateTime.DateTime import _findLocalTimeZoneName, _cache
> > > from DateTime import DateTime
> > > from datetime import datetime
> > > import pytz
> > > @@ -505,6 +505,14 @@
> > > dt4 = DateTime('2007-10-04T10:00:00+05:00')
> > > sdt4 = datetime(2007, 10, 4, 5, 0)
> > > self.assertEqual(dt4.utcdatetime(), sdt4)
> > > +
> > > + def testLegacyTimezones(self):
> > > + # check that all the legacy timezone names can actually be looked up
> > > + cache = _cache()
> > > + for key in cache._zmap.keys():
> > > + tz = cache[key]
> > > + for key in cache._zlst:
> > > + tz = cache[key]
> > >
> > >
> > > def test_suite():
> > >
> > > _______________________________________________
> > > Checkins mailing list
> > > Checkins at zope.org
> > > http://mail.zope.org/mailman/listinfo/checkins
> > >
> >
> >
> > --
> > Sidnei da Silva
> > Enfold Systems http://enfoldsystems.com
> > Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
> >
>
More information about the Zope-Checkins
mailing list