Clint Byrum has proposed merging lp:~clint-fewbar/txaws/drop-pytz into lp:txaws with lp:~clint-fewbar/txaws/drop-epsilon as a prerequisite.
Requested reviews: txAWS Developers (txaws-dev) Related bugs: Bug #912589 in txAWS: "pytz should be dropped for dateutil as soon as epsilon is dropped for dateutil" https://bugs.launchpad.net/txaws/+bug/912589 For more details, see: https://code.launchpad.net/~clint-fewbar/txaws/drop-pytz/+merge/87703 drops pytz for equivalent dateutil calls -- https://code.launchpad.net/~clint-fewbar/txaws/drop-pytz/+merge/87703 Your team txAWS Developers is requested to review the proposed merge of lp:~clint-fewbar/txaws/drop-pytz into lp:txaws.
=== modified file 'txaws/server/resource.py' --- txaws/server/resource.py 2011-12-20 10:40:24 +0000 +++ txaws/server/resource.py 2012-01-06 01:06:29 +0000 @@ -1,6 +1,6 @@ from datetime import datetime, timedelta from uuid import uuid4 -from pytz import UTC +from dateutil.tz import tzutc from twisted.python import log from twisted.python.reflect import safe_str @@ -159,7 +159,7 @@ def get_utc_time(self): """Return a C{datetime} object with the current time in UTC.""" - return datetime.now(UTC) + return datetime.now(tzutc()) def _validate(self, request): """Validate an L{HTTPRequest} before executing it. === modified file 'txaws/server/schema.py' --- txaws/server/schema.py 2011-12-01 14:19:12 +0000 +++ txaws/server/schema.py 2012-01-06 01:06:29 +0000 @@ -1,7 +1,7 @@ from datetime import datetime from operator import itemgetter -from pytz import UTC +from dateutil.tz import tzutc from zope.datetime import parse, SyntaxError @@ -243,7 +243,7 @@ def parse(self, value): try: - return datetime(*parse(value, local=False)[:6], tzinfo=UTC) + return datetime(*parse(value, local=False)[:6], tzinfo=tzutc()) except (TypeError, SyntaxError): raise ValueError() === modified file 'txaws/server/tests/test_resource.py' --- txaws/server/tests/test_resource.py 2011-12-20 10:40:24 +0000 +++ txaws/server/tests/test_resource.py 2012-01-06 01:06:29 +0000 @@ -1,7 +1,7 @@ from json import dumps, loads -from pytz import UTC from cStringIO import StringIO from datetime import datetime +from dateutil.tz import tzutc from twisted.trial.unittest import TestCase from twisted.python.reflect import safe_str @@ -542,7 +542,7 @@ self.assertEqual("data", request.response) self.assertEqual(200, request.code) - now = datetime(2009, 12, 31, tzinfo=UTC) + now = datetime(2009, 12, 31, tzinfo=tzutc()) self.api.get_utc_time = lambda: now self.api.principal = TestPrincipal(creds) return self.api.handle(request).addCallback(check) @@ -567,7 +567,7 @@ " 2010-01-01T12:00:00Z", request.response) self.assertEqual(400, request.code) - now = datetime(2010, 1, 1, 12, 0, 1, tzinfo=UTC) + now = datetime(2010, 1, 1, 12, 0, 1, tzinfo=tzutc()) self.api.get_utc_time = lambda: now return self.api.handle(request).addCallback(check) === modified file 'txaws/server/tests/test_schema.py' --- txaws/server/tests/test_schema.py 2011-12-01 14:30:28 +0000 +++ txaws/server/tests/test_schema.py 2012-01-06 01:06:29 +0000 @@ -2,7 +2,7 @@ from datetime import datetime -from pytz import UTC, FixedOffset +from dateutil.tz import tzutc, tzoffset from twisted.trial.unittest import TestCase @@ -318,7 +318,7 @@ def test_parse(self): """L{Date.parse checks that the given raw C{value} is a date/time.""" parameter = Date("Test") - date = datetime(2010, 9, 15, 23, 59, 59, tzinfo=UTC) + date = datetime(2010, 9, 15, 23, 59, 59, tzinfo=tzutc()) self.assertEqual(date, parameter.parse("2010-09-15T23:59:59Z")) def test_format(self): @@ -328,7 +328,7 @@ """ parameter = Date("Test") date = datetime(2010, 9, 15, 23, 59, 59, - tzinfo=FixedOffset(120)) + tzinfo=tzoffset('UTC', 120*60)) self.assertEqual("2010-09-15T21:59:59Z", parameter.format(date))
_______________________________________________ Mailing list: https://launchpad.net/~txaws-dev Post to : txaws-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~txaws-dev More help : https://help.launchpad.net/ListHelp