fixed : labels must be unicode strings

This commit is contained in:
Julien Veyssier 2011-07-04 23:52:16 +02:00 committed by Romain Bignon
commit 82ad25da3e

View file

@ -43,7 +43,7 @@ class AccountsPage(BasePage):
first_td = tr.getchildren()[0] first_td = tr.getchildren()[0]
if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g': if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g':
account = Account() account = Account()
account.label = first_td.find('a').text account.label = u"%s"%first_td.find('a').text
account.link_id = first_td.find('a').get('href', '') account.link_id = first_td.find('a').get('href', '')
account.id = first_td.find('a').text.split(' ')[0]+first_td.find('a').text.split(' ')[1] account.id = first_td.find('a').text.split(' ')[0]+first_td.find('a').text.split(' ')[1]
s = tr.getchildren()[2].text s = tr.getchildren()[2].text
@ -73,7 +73,7 @@ class OperationsPage(BasePage):
operation = Operation(index) operation = Operation(index)
index += 1 index += 1
operation.date = first_td.text operation.date = first_td.text
operation.label = tr.getchildren()[2].text.replace('\n',' ') operation.label = u"%s"%tr.getchildren()[2].text.replace('\n',' ')
if len(tr.getchildren()[3].text) > 2: if len(tr.getchildren()[3].text) > 2:
s = tr.getchildren()[3].text s = tr.getchildren()[3].text
elif len(tr.getchildren()[4].text) > 2: elif len(tr.getchildren()[4].text) > 2: