Hello community, here is the log from the commit of package python-isodate for openSUSE:Factory checked in at 2012-11-25 13:40:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-isodate (Old) and /work/SRC/openSUSE:Factory/.python-isodate.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-isodate", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/python-isodate/python-isodate.changes 2012-06-12 22:10:21.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-isodate.new/python-isodate.changes 2012-11-25 13:40:57.000000000 +0100 @@ -1,0 +2,9 @@ +Fri Nov 23 11:07:12 UTC 2012 - sasc...@suse.de + +- Update to version 0.4.9: + + support pickling FixedOffset instances + + make sure parsed fractional seconds are in microseconds + + add leading zeros when formattig microseconds (Jarom Loveridge) +- Spec file cleanup + +------------------------------------------------------------------- Old: ---- isodate-0.4.8.tar.gz New: ---- isodate-0.4.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-isodate.spec ++++++ --- /var/tmp/diff_new_pack.PlLhfc/_old 2012-11-25 13:40:58.000000000 +0100 +++ /var/tmp/diff_new_pack.PlLhfc/_new 2012-11-25 13:40:58.000000000 +0100 @@ -11,12 +11,13 @@ # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: python-isodate -Version: 0.4.8 +Version: 0.4.9 Release: 0 Url: http://cheeseshop.python.org/pypi/isodate Summary: An ISO 8601 Date/Time/Duration Parser and Formatter @@ -26,14 +27,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel BuildRequires: python-distribute -%if 0%{?suse_version} -%py_requires -%if 0%{?suse_version} > 1110 +%if 0%{?suse_version} && 0%{?suse_version} <= 1110 +%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%else BuildArch: noarch %endif -%endif -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} %description This module implements ISO 8601 date, time and duration parsing. @@ -46,14 +44,14 @@ %setup -q -n isodate-%{version} %build -CFLAGS="%{optflags}" python setup.py build - -%check -python setup.py test +python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%check +python setup.py test + %files %defattr(-,root,root,-) %doc CHANGES.txt README.txt TODO.txt ++++++ isodate-0.4.8.tar.gz -> isodate-0.4.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/CHANGES.txt new/isodate-0.4.9/CHANGES.txt --- old/isodate-0.4.8/CHANGES.txt 2012-05-04 12:06:05.000000000 +0200 +++ new/isodate-0.4.9/CHANGES.txt 2012-10-30 02:10:40.000000000 +0100 @@ -2,6 +2,14 @@ CHANGES ======= +0.4.9 (2012-10-30) +------------------ + +- support pickling FixedOffset instances +- make sure parsed fractional seconds are in microseconds +- add leading zeros when formattig microseconds (Jarom Loveridge) + + 0.4.8 (2012-05-04) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/PKG-INFO new/isodate-0.4.9/PKG-INFO --- old/isodate-0.4.8/PKG-INFO 2012-05-04 12:28:08.000000000 +0200 +++ new/isodate-0.4.9/PKG-INFO 2012-10-30 02:11:54.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.0 +Metadata-Version: 1.1 Name: isodate -Version: 0.4.8 +Version: 0.4.9 Summary: An ISO 8601 date/time/duration parser and formater Home-page: http://cheeseshop.python.org/pypi/isodate Author: Gerhard Weis @@ -107,12 +107,19 @@ The source release provides a *setup.py* script and a *buildout.cfg*. Both can be used to run the unit tests included. - Source code is available at `<http://hg.proclos.com/isodate>`_. - + Source code is available at `<http://github.com/gweis/isodate>`_. CHANGES ======= + 0.4.9 (2012-10-30) + ------------------ + + - support pickling FixedOffset instances + - make sure parsed fractional seconds are in microseconds + - add leading zeros when formattig microseconds (Jarom Loveridge) + + 0.4.8 (2012-05-04) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/README.txt new/isodate-0.4.9/README.txt --- old/isodate-0.4.8/README.txt 2012-01-06 02:35:38.000000000 +0100 +++ new/isodate-0.4.9/README.txt 2012-10-30 02:02:17.000000000 +0100 @@ -99,5 +99,4 @@ The source release provides a *setup.py* script and a *buildout.cfg*. Both can be used to run the unit tests included. -Source code is available at `<http://hg.proclos.com/isodate>`_. - +Source code is available at `<http://github.com/gweis/isodate>`_. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/setup.py new/isodate-0.4.9/setup.py --- old/isodate-0.4.8/setup.py 2012-05-04 12:04:29.000000000 +0200 +++ new/isodate-0.4.9/setup.py 2012-10-30 02:01:08.000000000 +0100 @@ -46,7 +46,7 @@ return open(os.path.join(os.path.dirname(__file__), *rnames)).read() setup(name='isodate', - version='0.4.8', + version='0.4.9', packages=['isodate', 'isodate.tests'], package_dir={'': 'src'}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/isostrf.py new/isodate-0.4.9/src/isodate/isostrf.py --- old/isodate-0.4.8/src/isodate/isostrf.py 2012-01-25 23:51:31.000000000 +0100 +++ new/isodate-0.4.9/src/isodate/isostrf.py 2012-10-30 01:15:04.000000000 +0100 @@ -83,7 +83,7 @@ D_ALT_BAS_ORD = 'P' + DATE_BAS_ORD_COMPLETE + 'T' + TIME_BAS_COMPLETE STRF_DT_MAP = {'%d': lambda tdt, yds: '%02d' % tdt.day, - '%f': lambda tdt, yds: '%d' % tdt.microsecond, + '%f': lambda tdt, yds: '%06d' % tdt.microsecond, '%H': lambda tdt, yds: '%02d' % tdt.hour, '%j': lambda tdt, yds: '%03d' % (tdt.toordinal() - date(tdt.year, 1, 1).toordinal() + @@ -103,7 +103,7 @@ '%%': lambda tdt, yds: '%'} STRF_D_MAP = {'%d': lambda tdt, yds: '%02d' % tdt.days, - '%f': lambda tdt, yds: '%d' % tdt.microseconds, + '%f': lambda tdt, yds: '%06d' % tdt.microseconds, '%H': lambda tdt, yds: '%02d' % (tdt.seconds / 60 / 60), '%m': lambda tdt, yds: '%02d' % tdt.months, '%M': lambda tdt, yds: '%02d' % ((tdt.seconds / 60) % 60), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/isotime.py new/isodate-0.4.9/src/isodate/isotime.py --- old/isodate-0.4.8/src/isodate/isotime.py 2010-10-13 01:17:23.000000000 +0200 +++ new/isodate-0.4.9/src/isodate/isotime.py 2012-10-30 01:04:55.000000000 +0100 @@ -123,7 +123,8 @@ int(groups['tzhour'] or 0), int(groups['tzmin'] or 0)) if 'second' in groups: - second = Decimal(groups['second']) + # round to microseconds if fractional seconds are more precise + second = Decimal(groups['second']).quantize(Decimal('.000001')) microsecond = (second - int(second)) * long(1e6) # int(...) ... no rounding # to_integral() ... rounding diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/tests/__init__.py new/isodate-0.4.9/src/isodate/tests/__init__.py --- old/isodate-0.4.8/src/isodate/tests/__init__.py 2012-01-26 00:37:46.000000000 +0100 +++ new/isodate-0.4.9/src/isodate/tests/__init__.py 2012-10-30 02:05:24.000000000 +0100 @@ -14,11 +14,11 @@ # may be used to endorse or promote products derived from this software # without specific prior written permission. # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN @@ -30,7 +30,7 @@ import unittest from isodate.tests import (test_date, test_time, test_datetime, test_duration, - test_strf) + test_strf, test_pickle) def test_suite(): ''' @@ -42,6 +42,7 @@ test_datetime.test_suite(), test_duration.test_suite(), test_strf.test_suite(), + test_pickle.test_suite(), ]) if __name__ == '__main__': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/tests/test_datetime.py new/isodate-0.4.9/src/isodate/tests/test_datetime.py --- old/isodate-0.4.8/src/isodate/tests/test_datetime.py 2011-04-16 04:06:37.000000000 +0200 +++ new/isodate-0.4.9/src/isodate/tests/test_datetime.py 2012-10-30 01:32:43.000000000 +0100 @@ -32,7 +32,7 @@ from isodate import parse_datetime, UTC, FixedOffset, datetime_isoformat from isodate import DATE_BAS_COMPLETE, TIME_BAS_MINUTE, TIME_BAS_COMPLETE -from isodate import DATE_EXT_COMPLETE, TIME_EXT_MINUTE +from isodate import DATE_EXT_COMPLETE, TIME_EXT_MINUTE, TIME_EXT_COMPLETE from isodate import TZ_BAS, TZ_EXT, TZ_HOUR from isodate import DATE_BAS_ORD_COMPLETE, DATE_EXT_ORD_COMPLETE from isodate import DATE_BAS_WEEK_COMPLETE, DATE_EXT_WEEK_COMPLETE @@ -41,27 +41,51 @@ # result from the parse_datetime method. A result of None means an ISO8601Error # is expected. TEST_CASES = [('19850412T1015', datetime(1985, 4, 12, 10, 15), - DATE_BAS_COMPLETE + 'T' + TIME_BAS_MINUTE), + DATE_BAS_COMPLETE + 'T' + TIME_BAS_MINUTE, + '19850412T1015'), ('1985-04-12T10:15', datetime(1985, 4, 12, 10, 15), - DATE_EXT_COMPLETE + 'T' + TIME_EXT_MINUTE), + DATE_EXT_COMPLETE + 'T' + TIME_EXT_MINUTE, + '1985-04-12T10:15'), ('1985102T1015Z', datetime(1985, 4, 12, 10, 15, tzinfo=UTC), - DATE_BAS_ORD_COMPLETE + 'T' + TIME_BAS_MINUTE + TZ_BAS), + DATE_BAS_ORD_COMPLETE + 'T' + TIME_BAS_MINUTE + TZ_BAS, + '1985102T1015Z'), ('1985-102T10:15Z', datetime(1985, 4, 12, 10, 15, tzinfo=UTC), - DATE_EXT_ORD_COMPLETE + 'T' + TIME_EXT_MINUTE + TZ_EXT), + DATE_EXT_ORD_COMPLETE + 'T' + TIME_EXT_MINUTE + TZ_EXT, + '1985-102T10:15Z'), ('1985W155T1015+0400', datetime(1985, 4, 12, 10, 15, tzinfo=FixedOffset(4, 0, '+0400')), - DATE_BAS_WEEK_COMPLETE + 'T' + TIME_BAS_MINUTE + TZ_BAS), + DATE_BAS_WEEK_COMPLETE + 'T' + TIME_BAS_MINUTE + TZ_BAS, + '1985W155T1015+0400'), ('1985-W15-5T10:15+04', datetime(1985, 4, 12, 10, 15, tzinfo=FixedOffset(4, 0, - '+0400')), - DATE_EXT_WEEK_COMPLETE + 'T' + TIME_EXT_MINUTE + TZ_HOUR), + '+0400'),), + DATE_EXT_WEEK_COMPLETE + 'T' + TIME_EXT_MINUTE + TZ_HOUR, + '1985-W15-5T10:15+04'), ('20110410T101225.123000Z', datetime(2011, 4, 10, 10, 12, 25, 123000, tzinfo=UTC), - DATE_BAS_COMPLETE + 'T' + TIME_BAS_COMPLETE + ".%f" + TZ_BAS)] + DATE_BAS_COMPLETE + 'T' + TIME_BAS_COMPLETE + ".%f" + TZ_BAS, + '20110410T101225.123000Z'), + ('2012-10-12T08:29:46.069178Z', + datetime(2012, 10, 12, 8, 29, 46, 69178, tzinfo=UTC), + DATE_EXT_COMPLETE + 'T' + TIME_EXT_COMPLETE + '.%f' + TZ_BAS, + '2012-10-12T08:29:46.069178Z'), + ('2012-10-12T08:29:46.691780Z', + datetime(2012, 10, 12, 8, 29, 46, 691780, tzinfo=UTC), + DATE_EXT_COMPLETE + 'T' + TIME_EXT_COMPLETE + '.%f' + TZ_BAS, + '2012-10-12T08:29:46.691780Z'), + ('2012-10-30T08:55:22.1234567Z', + datetime(2012, 10, 30, 8, 55, 22, 123457, tzinfo=UTC), + DATE_EXT_COMPLETE + 'T' + TIME_EXT_COMPLETE + '.%f' + TZ_BAS, + '2012-10-30T08:55:22.123457Z'), + ('2012-10-30T08:55:22.1234561Z', + datetime(2012, 10, 30, 8, 55, 22, 123456, tzinfo=UTC), + DATE_EXT_COMPLETE + 'T' + TIME_EXT_COMPLETE + '.%f' + TZ_BAS, + '2012-10-30T08:55:22.123456Z') + ] -def create_testcase(datetimestring, expectation, format): +def create_testcase(datetimestring, expectation, format, output): """ Create a TestCase class for a specific test. @@ -92,7 +116,7 @@ datetime_isoformat, expectation, format) else: self.assertEqual(datetime_isoformat(expectation, format), - datetimestring) + output) return unittest.TestLoader().loadTestsFromTestCase(TestDateTime) @@ -102,8 +126,8 @@ Construct a TestSuite instance for all test cases. ''' suite = unittest.TestSuite() - for datetimestring, expectation, format in TEST_CASES: - suite.addTest(create_testcase(datetimestring, expectation, format)) + for datetimestring, expectation, format, output in TEST_CASES: + suite.addTest(create_testcase(datetimestring, expectation, format, output)) return suite if __name__ == '__main__': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/tests/test_pickle.py new/isodate-0.4.9/src/isodate/tests/test_pickle.py --- old/isodate-0.4.8/src/isodate/tests/test_pickle.py 1970-01-01 01:00:00.000000000 +0100 +++ new/isodate-0.4.9/src/isodate/tests/test_pickle.py 2012-10-30 01:58:49.000000000 +0100 @@ -0,0 +1,31 @@ +import unittest +import cPickle as pickle +import isodate + + +class TestPickle(unittest.TestCase): + ''' + A test case template to parse an ISO datetime string into a + datetime object. + ''' + + def test_pickle(self): + ''' + Parse an ISO datetime string and compare it to the expected value. + ''' + dti = isodate.parse_datetime('2012-10-26T09:33+00:00') + pikl = pickle.dumps(dti, 2) + dto = pickle.loads(pikl) + self.assertEqual(dti, dto) + + +def test_suite(): + ''' + Construct a TestSuite instance for all test cases. + ''' + suite = unittest.TestSuite() + suite.addTest(unittest.TestLoader().loadTestsFromTestCase(TestPickle)) + return suite + +if __name__ == '__main__': + unittest.main(defaultTest='test_suite') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/tests/test_strf.py new/isodate-0.4.9/src/isodate/tests/test_strf.py --- old/isodate-0.4.8/src/isodate/tests/test_strf.py 2012-05-04 10:43:10.000000000 +0200 +++ new/isodate-0.4.9/src/isodate/tests/test_strf.py 2012-10-30 01:04:55.000000000 +0100 @@ -41,6 +41,11 @@ # DST ON (datetime(1999, 12, 25, 13, 30, 0, 0, LOCAL), DT_EXT_COMPLETE, "1999-12-25T13:30:00+11:00"), + # microseconds + (datetime(2012, 10, 12, 8, 29, 46, 69178), "%Y-%m-%dT%H:%M:%S.%f", + "2012-10-12T08:29:46.069178"), + (datetime(2012, 10, 12, 8, 29, 46, 691780), "%Y-%m-%dT%H:%M:%S.%f", + "2012-10-12T08:29:46.691780"), ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate/tzinfo.py new/isodate-0.4.9/src/isodate/tzinfo.py --- old/isodate-0.4.8/src/isodate/tzinfo.py 2012-01-25 23:50:55.000000000 +0100 +++ new/isodate-0.4.9/src/isodate/tzinfo.py 2012-10-30 01:58:32.000000000 +0100 @@ -1,5 +1,5 @@ ''' -This module provides some datetime.tzinfo implementations. +This module provides some datetime.tzinfo implementations. All those classes are taken from the Python documentation. ''' @@ -7,14 +7,14 @@ import time ZERO = timedelta(0) -# constant for zero time offset. +# constant for zero time offset. class Utc(tzinfo): '''UTC - + Universal time coordinated time zone. ''' - + def utcoffset(self, dt): ''' Return offset from UTC in minutes east of UTC, which is ZERO for UTC. @@ -39,16 +39,16 @@ class FixedOffset(tzinfo): ''' A class building tzinfo objects for fixed-offset time zones. - - Note that FixedOffset(0, "UTC") is a different way to build a - UTC tzinfo object. + + Note that FixedOffset(0, 0, "UTC") or FixedOffset() is a different way to + build a UTC tzinfo object. ''' - - def __init__(self, offset_hours, offset_minutes, name): + + def __init__(self, offset_hours=0, offset_minutes=0, name="UTC"): ''' Initialise an instance with time offset and name. The time offset should be positive for time zones east of UTC - and negate for time zones west of UTC. + and negate for time zones west of UTC. ''' self.__offset = timedelta(hours=offset_hours, minutes=offset_minutes) self.__name = name @@ -68,11 +68,11 @@ def dst(self, dt): ''' - Return the daylight saving time (DST) adjustment, in minutes east of + Return the daylight saving time (DST) adjustment, in minutes east of UTC. ''' return ZERO - + def __repr__(self): ''' Return nicely formatted repr string. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate.egg-info/PKG-INFO new/isodate-0.4.9/src/isodate.egg-info/PKG-INFO --- old/isodate-0.4.8/src/isodate.egg-info/PKG-INFO 2012-05-04 12:28:08.000000000 +0200 +++ new/isodate-0.4.9/src/isodate.egg-info/PKG-INFO 2012-10-30 02:11:54.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.0 +Metadata-Version: 1.1 Name: isodate -Version: 0.4.8 +Version: 0.4.9 Summary: An ISO 8601 date/time/duration parser and formater Home-page: http://cheeseshop.python.org/pypi/isodate Author: Gerhard Weis @@ -107,12 +107,19 @@ The source release provides a *setup.py* script and a *buildout.cfg*. Both can be used to run the unit tests included. - Source code is available at `<http://hg.proclos.com/isodate>`_. - + Source code is available at `<http://github.com/gweis/isodate>`_. CHANGES ======= + 0.4.9 (2012-10-30) + ------------------ + + - support pickling FixedOffset instances + - make sure parsed fractional seconds are in microseconds + - add leading zeros when formattig microseconds (Jarom Loveridge) + + 0.4.8 (2012-05-04) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/isodate-0.4.8/src/isodate.egg-info/SOURCES.txt new/isodate-0.4.9/src/isodate.egg-info/SOURCES.txt --- old/isodate-0.4.8/src/isodate.egg-info/SOURCES.txt 2012-05-04 12:28:08.000000000 +0200 +++ new/isodate-0.4.9/src/isodate.egg-info/SOURCES.txt 2012-10-30 02:11:54.000000000 +0100 @@ -21,5 +21,6 @@ src/isodate/tests/test_date.py src/isodate/tests/test_datetime.py src/isodate/tests/test_duration.py +src/isodate/tests/test_pickle.py src/isodate/tests/test_strf.py src/isodate/tests/test_time.py \ No newline at end of file -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org