From 56090917b8aa010c0f6fdb4ad6025c1e35d23c07 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Mar 2011 10:54:56 -0700 Subject: [PATCH] oops --- src/calibre/library/sqlite.py | 10 +++++----- src/calibre/utils/speedup.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/calibre/library/sqlite.py b/src/calibre/library/sqlite.py index e19d82749b..2075ab5880 100644 --- a/src/calibre/library/sqlite.py +++ b/src/calibre/library/sqlite.py @@ -38,17 +38,17 @@ def _c_convert_timestamp(val): ret = None if ret is None: return parse_date(val, as_utc=False) - year, month, day, hour, minutes, seconds, tzmins = ret + year, month, day, hour, minutes, seconds, tzsecs = ret return datetime(year, month, day, hour, minutes, seconds, - tzinfo=tzoffset(None, tzmins)).astimezone(local_tz) + tzinfo=tzoffset(None, tzsecs)).astimezone(local_tz) def _py_convert_timestamp(val): if val: - tzmins = 0 + tzsecs = 0 try: sign = {'+':1, '-':-1}.get(val[-6], None) if sign is not None: - tzmins = (int(val[-5:-3])*60 + int(val[-2:])) * sign + tzsecs = 60*((int(val[-5:-3])*60 + int(val[-2:])) * sign) year = int(val[0:4]) month = int(val[5:7]) day = int(val[8:10]) @@ -56,7 +56,7 @@ def _py_convert_timestamp(val): min = int(val[14:16]) sec = int(val[17:19]) return datetime(year, month, day, hour, min, sec, - tzinfo=tzoffset(None, tzmins)).astimezone(local_tz) + tzinfo=tzoffset(None, tzsecs)) except: pass return parse_date(val, as_utc=False) diff --git a/src/calibre/utils/speedup.c b/src/calibre/utils/speedup.c index 11dc16909e..af6c9e7959 100644 --- a/src/calibre/utils/speedup.c +++ b/src/calibre/utils/speedup.c @@ -45,7 +45,7 @@ speedup_parse_date(PyObject *self, PyObject *args) { tz = orig + len - 6; - if (*tz == '+') sign = 1; + if (*tz == '+') sign = +1; if (*tz == '-') sign = -1; if (sign != 0) { // We have TZ info @@ -60,7 +60,7 @@ speedup_parse_date(PyObject *self, PyObject *args) { } return Py_BuildValue("lllllll", year, month, day, hour, minute, second, - (tzh*60 + tzm)*sign); + (tzh*60 + tzm)*sign*60); } static PyMethodDef speedup_methods[] = {