r1210 - in python-tz/trunk (3 files)
Fabio Tranchitella
kobold at alioth.debian.org
Wed Mar 19 08:31:18 UTC 2008
Date: Wednesday, March 19, 2008 @ 08:31:17
Author: kobold
Revision: 1210
Updates.
Modified:
python-tz/trunk/debian/control
python-tz/trunk/debian/rules
python-tz/trunk/pytz/__init__.py
Modified: python-tz/trunk/debian/control
===================================================================
--- python-tz/trunk/debian/control 2008-03-19 08:13:23 UTC (rev 1209)
+++ python-tz/trunk/debian/control 2008-03-19 08:31:17 UTC (rev 1210)
@@ -6,6 +6,7 @@
Build-Depends: debhelper (>= 5.0.38)
Build-Depends-Indep: python-all-dev (>= 2.3.5-9), python-central (>= 0.5), python-setuptools (>= 0.6b3)
Standards-Version: 3.7.3
+Homepage: http://pytz.sourceforge.net/
XS-Python-Version: all
Package: python-tz
@@ -21,5 +22,3 @@
It also solves the issue of ambiguous times at the end of daylight savings,
which you can read more about in the Python Library Reference
(datetime.tzinfo).
- .
- Homepage: http://pytz.sourceforge.net/
Modified: python-tz/trunk/debian/rules
===================================================================
--- python-tz/trunk/debian/rules 2008-03-19 08:13:23 UTC (rev 1209)
+++ python-tz/trunk/debian/rules 2008-03-19 08:31:17 UTC (rev 1210)
@@ -39,9 +39,6 @@
install-python%:
python$* setup.py install --no-compile --single-version-externally-managed --root=debian/$(PACKAGE)
- # Remove python and module version from .egg-info
- mv debian/$(PACKAGE)/usr/lib/python$*/site-packages/$(PYMOD)-$(DEB_UPSTREAM_VERSION)-py$*.egg-info \
- debian/$(PACKAGE)/usr/lib/python$*/site-packages/$(PYMOD).egg-info
# remove zoneinfo, our patch to pytz makes it use the one from tzdata
rm -rf debian/$(PACKAGE)/usr/lib/python$*/site-packages/pytz/zoneinfo
# install our testing package
@@ -74,8 +71,7 @@
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
.PHONY: binary-arch
-binary-arch: install
- $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
+binary-arch:
.PHONY: binary
binary: binary-indep binary-arch
Modified: python-tz/trunk/pytz/__init__.py
===================================================================
--- python-tz/trunk/pytz/__init__.py 2008-03-19 08:13:23 UTC (rev 1209)
+++ python-tz/trunk/pytz/__init__.py 2008-03-19 08:31:17 UTC (rev 1210)
@@ -9,7 +9,7 @@
'''
# The Olson database has historically been updated about 4 times a year
-OLSON_VERSION = '2007d'
+OLSON_VERSION = '2008a'
VERSION = OLSON_VERSION
#VERSION = OLSON_VERSION + '.2'
__version__ = OLSON_VERSION
@@ -52,8 +52,8 @@
raise ValueError('Bad path segment: %r' % part)
filename = os.path.join('/usr/share/zoneinfo', *name_parts)
return open(filename, 'rb')
-
+
# Enable this when we get some translations?
# We want an i18n API that is useful to programs using Python's gettext
# module, as well as the Zope3 i18n package. Perhaps we should just provide
@@ -88,13 +88,15 @@
_tzinfo_cache = {}
def timezone(zone):
- ''' Return a datetime.tzinfo implementation for the given timezone
+ r''' Return a datetime.tzinfo implementation for the given timezone
>>> from datetime import datetime, timedelta
>>> utc = timezone('UTC')
>>> eastern = timezone('US/Eastern')
>>> eastern.zone
'US/Eastern'
+ >>> timezone(u'US/Eastern') is eastern
+ True
>>> utc_dt = datetime(2002, 10, 27, 6, 0, 0, tzinfo=utc)
>>> loc_dt = utc_dt.astimezone(eastern)
>>> fmt = '%Y-%m-%d %H:%M:%S %Z (%z)'
@@ -113,10 +115,21 @@
Traceback (most recent call last):
...
UnknownTimeZoneError: 'Asia/Shangri-La'
+
+ >>> timezone(u'\N{TRADE MARK SIGN}')
+ Traceback (most recent call last):
+ ...
+ UnknownTimeZoneError: u'\u2122'
'''
if zone.upper() == 'UTC':
return utc
+ try:
+ zone = zone.encode('US-ASCII')
+ except UnicodeEncodeError:
+ # All valid timezones are ASCII
+ raise UnknownTimeZoneError(zone)
+
zone = _unmunge_zone(zone)
if zone not in _tzinfo_cache:
if zone in all_timezones_set:
@@ -235,6 +248,8 @@
['Europe/Zurich']
>>> country_timezones('CH')
['Europe/Zurich']
+ >>> country_timezones(u'ch')
+ ['Europe/Zurich']
>>> country_timezones('XXX')
Traceback (most recent call last):
...
@@ -492,6 +507,7 @@
'America/Maceio',
'America/Managua',
'America/Manaus',
+ 'America/Marigot',
'America/Martinique',
'America/Mazatlan',
'America/Mendoza',
@@ -530,6 +546,7 @@
'America/Sao_Paulo',
'America/Scoresbysund',
'America/Shiprock',
+ 'America/St_Barthelemy',
'America/St_Johns',
'America/St_Kitts',
'America/St_Lucia',
@@ -947,6 +964,7 @@
'America/Indiana/Knox',
'America/Indiana/Marengo',
'America/Indiana/Petersburg',
+ 'America/Indiana/Tell_City',
'America/Indiana/Vevay',
'America/Indiana/Vincennes',
'America/Indiana/Winamac',
@@ -966,6 +984,7 @@
'America/Maceio',
'America/Managua',
'America/Manaus',
+ 'America/Marigot',
'America/Martinique',
'America/Mazatlan',
'America/Mendoza',
@@ -1006,6 +1025,7 @@
'America/Sao_Paulo',
'America/Scoresbysund',
'America/Shiprock',
+ 'America/St_Barthelemy',
'America/St_Johns',
'America/St_Kitts',
'America/St_Lucia',
More information about the pkg-zope-commits
mailing list