Revert to 1.5.
This commit is contained in:
parent
fda43b2554
commit
b612e52404
@ -1,74 +0,0 @@
|
|||||||
diff -up python-dateutil-1.5/dateutil/zoneinfo/__init__.py\~ python-dateutil-1.5/dateutil/zoneinfo/__init__.py
|
|
||||||
--- python-dateutil-1.5/dateutil/zoneinfo/__init__.py~ 2005-12-22 19:13:50.000000000 +0100
|
|
||||||
+++ python-dateutil-1.5/dateutil/zoneinfo/__init__.py 2011-08-17 15:24:29.019214748 +0200
|
|
||||||
@@ -15,6 +15,7 @@ __all__ = ["setcachesize", "gettz", "reb
|
|
||||||
|
|
||||||
CACHE = []
|
|
||||||
CACHESIZE = 10
|
|
||||||
+USE_SYSTEM_ZONEINFO = True # XXX configure at build time
|
|
||||||
|
|
||||||
class tzfile(tzfile):
|
|
||||||
def __reduce__(self):
|
|
||||||
@@ -29,7 +30,8 @@ def getzoneinfofile():
|
|
||||||
return os.path.join(os.path.dirname(__file__), entry)
|
|
||||||
return None
|
|
||||||
|
|
||||||
-ZONEINFOFILE = getzoneinfofile()
|
|
||||||
+ZONEINFOFILE = getzoneinfofile() if USE_SYSTEM_ZONEINFO else None
|
|
||||||
+ZONEINFODIR = (os.getenv("TZDIR") or "/usr/share/zoneinfo").rstrip(os.sep)
|
|
||||||
|
|
||||||
del getzoneinfofile
|
|
||||||
|
|
||||||
@@ -39,22 +40,37 @@ def setcachesize(size):
|
|
||||||
del CACHE[size:]
|
|
||||||
|
|
||||||
def gettz(name):
|
|
||||||
- tzinfo = None
|
|
||||||
- if ZONEINFOFILE:
|
|
||||||
- for cachedname, tzinfo in CACHE:
|
|
||||||
- if cachedname == name:
|
|
||||||
- break
|
|
||||||
+ for cachedname, tzinfo in CACHE:
|
|
||||||
+ if cachedname == name:
|
|
||||||
+ return tzinfo
|
|
||||||
+
|
|
||||||
+ name_parts = name.lstrip('/').split('/')
|
|
||||||
+ for part in name_parts:
|
|
||||||
+ if part == os.path.pardir or os.path.sep in part:
|
|
||||||
+ raise ValueError('Bad path segment: %r' % part)
|
|
||||||
+ filename = os.path.join(ZONEINFODIR, *name_parts)
|
|
||||||
+ try:
|
|
||||||
+ zonefile = open(filename, "rb")
|
|
||||||
+ except:
|
|
||||||
+ tzinfo = None
|
|
||||||
+ else:
|
|
||||||
+ tzinfo = tzfile(zonefile)
|
|
||||||
+ zonefile.close()
|
|
||||||
+
|
|
||||||
+ if tzinfo is None and ZONEINFOFILE:
|
|
||||||
+ tf = TarFile.open(ZONEINFOFILE)
|
|
||||||
+ try:
|
|
||||||
+ zonefile = tf.extractfile(name)
|
|
||||||
+ except KeyError:
|
|
||||||
+ tzinfo = None
|
|
||||||
else:
|
|
||||||
- tf = TarFile.open(ZONEINFOFILE)
|
|
||||||
- try:
|
|
||||||
- zonefile = tf.extractfile(name)
|
|
||||||
- except KeyError:
|
|
||||||
- tzinfo = None
|
|
||||||
- else:
|
|
||||||
- tzinfo = tzfile(zonefile)
|
|
||||||
- tf.close()
|
|
||||||
- CACHE.insert(0, (name, tzinfo))
|
|
||||||
- del CACHE[CACHESIZE:]
|
|
||||||
+ tzinfo = tzfile(zonefile)
|
|
||||||
+ tf.close()
|
|
||||||
+
|
|
||||||
+ if tzinfo is not None:
|
|
||||||
+ CACHE.insert(0, (name, tzinfo))
|
|
||||||
+ del CACHE[CACHESIZE:]
|
|
||||||
+
|
|
||||||
return tzinfo
|
|
||||||
|
|
||||||
def rebuild(filename, tag=None, format="gz"):
|
|
@ -1,13 +1,14 @@
|
|||||||
Name: python-dateutil
|
Name: python-dateutil
|
||||||
Version: 2.2
|
Version: 1.5
|
||||||
Release: 1%{?dist}
|
Release: 0%{?dist}
|
||||||
|
Epoch: 1
|
||||||
Summary: Powerful extensions to the standard datetime module
|
Summary: Powerful extensions to the standard datetime module
|
||||||
|
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
License: Python
|
License: Python
|
||||||
URL: http://labix.org/python-dateutil
|
URL: http://labix.org/python-dateutil
|
||||||
Source0: http://labix.org/download/%{name}/%{name}-%{version}.tar.gz
|
Source0: http://labix.org/download/%{name}/%{name}-%{version}.tar.gz
|
||||||
Patch0: python-dateutil-2.0-system-zoneinfo.patch
|
Patch0: python-dateutil-1.5-system-zoneinfo.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python-devel,python-setuptools
|
BuildRequires: python-devel,python-setuptools
|
||||||
@ -36,6 +37,9 @@ mv NEWS.new NEWS
|
|||||||
%{python_sitelib}/*.egg-info
|
%{python_sitelib}/*.egg-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Aug 05 2014 Jon Ciesla <limburgher@gmail.com> - 1:1.5-9
|
||||||
|
- Reverting to 1.5 pre user feedback and upstream.
|
||||||
|
|
||||||
* Mon Aug 04 2014 Jon Ciesla <limburgher@gmail.com> - 2.2-1
|
* Mon Aug 04 2014 Jon Ciesla <limburgher@gmail.com> - 2.2-1
|
||||||
- Update to 2.2, BZ 1126521.
|
- Update to 2.2, BZ 1126521.
|
||||||
- Fix bad dates.
|
- Fix bad dates.
|
||||||
|
Loading…
Reference in New Issue
Block a user