store transactions dates as datetime.date objects

This commit is contained in:
Romain Bignon 2012-03-09 13:20:47 +01:00
commit 679177d450

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Nicolas Duhamel
# Copyright(C) 2010-2012 Nicolas Duhamel
#
# This file is part of weboob.
#
@ -18,6 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from datetime import date
import re
from weboob.capabilities.bank import Transaction
@ -37,9 +38,12 @@ class AccountHistory(BasePage):
for mvt in mvt_ligne:
operation = Transaction(len(operations))
operation.date = mvt.xpath("./td/span")[0].text
d = mvt.xpath("./td/span")[0].text.strip().split('/')
operation.date = date(*reversed([int(x) for x in d]))
tmp = mvt.xpath("./td/span")[1]
operation.raw = unicode(self.parser.tocleanstring(tmp))
operation.raw = unicode(self.parser.tocleanstring(tmp).strip())
r = re.compile(r'\d+')