From b440918eca868fc16b130916463f92d465939f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Wed, 28 Mar 2012 11:34:47 +0200 Subject: [PATCH] LCL,BNPorc: fix str to unicode conversion warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pierre Mazière --- modules/bnporc/pages/accounts_list.py | 2 +- modules/lcl/pages.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bnporc/pages/accounts_list.py b/modules/bnporc/pages/accounts_list.py index bca7ebf6..06cdb33f 100644 --- a/modules/bnporc/pages/accounts_list.py +++ b/modules/bnporc/pages/accounts_list.py @@ -56,7 +56,7 @@ class AccountsList(BasePage): if len(str(account.id)) == 23: account.id = str(account.id)[5:21] - account.label = tr.xpath('.//td[@class="libelleCompte"]/a')[0].text.strip() + account.label = u''+tr.xpath('.//td[@class="libelleCompte"]/a')[0].text.strip() tds = tr.findall('td') account.balance = self._parse_amount(tds[3].find('a')) diff --git a/modules/lcl/pages.py b/modules/lcl/pages.py index 457cd024..37a7e6f1 100644 --- a/modules/lcl/pages.py +++ b/modules/lcl/pages.py @@ -145,7 +145,7 @@ class AccountsPage(BasePage): # TODO parse this string to get the right Account.TYPE_* to # store in account.type. account._type=value - account.label=a.getparent().getprevious().text.strip() + account.label=u''+a.getparent().getprevious().text.strip() balance=a.text.replace(u"\u00A0",'').replace(' ','').replace('.','').replace('+','').replace(',','.') if '-' in balance: balance='-'+balance.strip().replace('-', '')