fix pyflakes/flake8 issue

date is imported as a module, avoid using it as a variable.
also PEP8 fix.
This commit is contained in:
Laurent Bachelier 2013-02-10 20:16:34 +01:00
commit 79769265cf

View file

@ -28,16 +28,17 @@ except ImportError:
__all__ = ['local2utc', 'utc2local', 'LinearDateGuesser'] __all__ = ['local2utc', 'utc2local', 'LinearDateGuesser']
def local2utc(date): def local2utc(dateobj):
date = date.replace(tzinfo=tz.tzlocal()) dateobj = dateobj.replace(tzinfo=tz.tzlocal())
date = date.astimezone(tz.tzutc()) dateobj = dateobj.astimezone(tz.tzutc())
return date return dateobj
def utc2local(date): def utc2local(dateobj):
date = date.replace(tzinfo=tz.tzutc()) dateobj = dateobj.replace(tzinfo=tz.tzutc())
date = date.astimezone(tz.tzlocal()) dateobj = dateobj.astimezone(tz.tzlocal())
return date return dateobj
class LinearDateGuesser(object): class LinearDateGuesser(object):
""" """