diff --git a/modules/alloresto/pages.py b/modules/alloresto/pages.py index 48367911..136452fc 100644 --- a/modules/alloresto/pages.py +++ b/modules/alloresto/pages.py @@ -49,9 +49,9 @@ class AccountsPage(LoggedPage, HTMLPage): obj_id = '0' obj_label = u'Compte miams' - obj_balance = CleanDecimal('//div[@class="compteur"]//strong') + obj_balance = CleanDecimal('//div[@class="compteur"]//strong', replace_dots=True) obj_currency = u'MIAM' - obj_coming = CleanDecimal('//table[@id="solde_acquisition_lignes"]//th[@class="col_montant"]', default=Decimal('0')) + obj_coming = CleanDecimal('//table[@id="solde_acquisition_lignes"]//th[@class="col_montant"]', default=Decimal('0'), replace_dots=True) class MyDate(Filter): MONTHS = ['janv', u'févr', u'mars', u'avr', u'mai', u'juin', u'juil', u'août', u'sept', u'oct', u'nov', u'déc'] diff --git a/modules/carrefourbanque/pages.py b/modules/carrefourbanque/pages.py index 6301423f..4ccdc16e 100644 --- a/modules/carrefourbanque/pages.py +++ b/modules/carrefourbanque/pages.py @@ -53,7 +53,7 @@ class HomePage(LoggedPage, HTMLPage): obj_id = Regexp(CleanText('./div[@class="carte_col_leftcol"]/p'), r'(\d+)') obj_label = CleanText('./div[@class="carte_col_leftcol"]/h2') - obj_balance = CleanDecimal(Format('-%s', CleanText('.//div[@class="catre_col_one"]/h2'))) + obj_balance = CleanDecimal(Format('-%s', CleanText('.//div[@class="catre_col_one"]/h2')), replace_dots=True) obj_currency = FrenchTransaction.Currency('.//div[@class="catre_col_one"]/h2') obj__link = Link('.//a[contains(@href, "solde-dernieres-operations")]') diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index d63666f2..0f7a1dfa 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -123,7 +123,7 @@ class AccountsPage(LoggedPage, HTMLPage): if not 'rib' in p: raise SkipItem() - balance = CleanDecimal('./td[2] | ./td[3]')(self) + balance = CleanDecimal('./td[2] | ./td[3]', replace_dots=True)(self) id = p['rib'][0] # Handle cards diff --git a/modules/freemobile/pages/history.py b/modules/freemobile/pages/history.py index ef3b0914..a1fce5ce 100644 --- a/modules/freemobile/pages/history.py +++ b/modules/freemobile/pages/history.py @@ -84,7 +84,7 @@ class DetailsPage(LoggedPage, BadUTF8Page): detail.label = detail.label + u" (international)" detail.id = detail.id + "-inter" detail.infos = CleanText('div[@class="conso"]/p')(div) - detail.price = CleanDecimal('div[@class="horsForfait"]/p/span', default=Decimal(0))(div) + detail.price = CleanDecimal('div[@class="horsForfait"]/p/span', default=Decimal(0), replace_dots=True)(div) self.details[num].append(detail) @@ -96,7 +96,7 @@ class DetailsPage(LoggedPage, BadUTF8Page): if inter: voice.label = voice.label + " (international)" voice.id = voice.id + "-inter" - voice.price = CleanDecimal('div[@class="horsForfait"]/p/span', default=0)(div) + voice.price = CleanDecimal('div[@class="horsForfait"]/p/span', default=Decimal(0), replace_dots=True)(div) voice1 = CleanText('.//span[@class="actif"][1]')(voicediv) voice2 = CleanText('.//span[@class="actif"][2]')(voicediv) voice.infos = unicode(string) % (voice1, voice2) @@ -155,4 +155,4 @@ class HistoryPage(LoggedPage, BadUTF8Page): obj_datetime = DateTime(CleanText('td[1]', symbols=u'à'), dayfirst=True) obj_label = Format(u'%s %s %s', CleanText('td[2]'), CleanText('td[3]'), CleanText('td[4]')) - obj_price = CleanDecimal('td[5]', default=Decimal(0)) + obj_price = CleanDecimal('td[5]', default=Decimal(0), replace_dots=True) diff --git a/modules/groupamaes/pages.py b/modules/groupamaes/pages.py index f7e3c4fe..98257e65 100644 --- a/modules/groupamaes/pages.py +++ b/modules/groupamaes/pages.py @@ -53,8 +53,7 @@ class AvoirPage(LoggedPage, HTMLPage): obj_id = CleanText(TableCell('name')) obj_label = CleanText(TableCell('name')) - #obj_coming = CleanDecimal(TableCell('value')) - obj_balance = CleanDecimal(TableCell('value')) + obj_balance = CleanDecimal(TableCell('value'), replace_dots=True) obj_currency = CleanText(u'//table[@summary="Liste des échéances"]/thead/tr/th/small/text()') obj_type = Account.TYPE_UNKNOWN @@ -80,7 +79,7 @@ class OperationsFuturesPage(LoggedPage, HTMLPage): obj_date = Date(CleanText(TableCell('date')), LinearDateGuesser()) obj_type = Transaction.TYPE_UNKNOWN obj_label = CleanText(TableCell('operation')) - obj_amount = CleanDecimal(TableCell('montant')) + obj_amount = CleanDecimal(TableCell('montant'), replace_dots=True) class OperationsTraiteesPage(LoggedPage, HTMLPage): @@ -102,4 +101,4 @@ class OperationsTraiteesPage(LoggedPage, HTMLPage): obj_date = Date(CleanText(TableCell('date')), LinearDateGuesser()) obj_type = Transaction.TYPE_UNKNOWN obj_label = CleanText(TableCell('operation')) - obj_amount = CleanDecimal(TableCell('montant')) + obj_amount = CleanDecimal(TableCell('montant'), replace_dots=True) diff --git a/modules/hsbc/pages.py b/modules/hsbc/pages.py index 42309e3e..409edfd2 100644 --- a/modules/hsbc/pages.py +++ b/modules/hsbc/pages.py @@ -92,7 +92,7 @@ class AccountsPage(LoggedPage, HTMLPage): else: raise SkipItem() - balance = CleanDecimal('./td[3]')(self) + balance = CleanDecimal('./td[3]', replace_dots=True)(self) self.env['id'] = id self.env['balance'] = balance diff --git a/modules/ing/pages/accounts_list.py b/modules/ing/pages/accounts_list.py index 58dcb483..6ca08d73 100644 --- a/modules/ing/pages/accounts_list.py +++ b/modules/ing/pages/accounts_list.py @@ -127,7 +127,7 @@ class AccountsList(LoggedPage, HTMLPage): obj_label = CleanText('span[@class="title"]') obj_id = AddPref(Field('_id'), Field('label')) obj_type = AddType(Field('label')) - obj_balance = CleanDecimal('span[@class="solde"]/label') + obj_balance = CleanDecimal('span[@class="solde"]/label', replace_dots=True) obj_coming = NotAvailable obj__jid = Attr('//input[@name="javax.faces.ViewState"]', 'value') @@ -141,7 +141,7 @@ class AccountsList(LoggedPage, HTMLPage): obj_id = None # will be overwrited by the browser # we use lower for compatibility with the old website obj_raw = Transaction.Raw(Lower('.//td[@class="lbl"]')) - obj_amount = CleanDecimal('.//td[starts-with(@class, "amount")]') + obj_amount = CleanDecimal('.//td[starts-with(@class, "amount")]', replace_dots=True) obj_date = INGDate(CleanText('.//td[@class="date"]'), dayfirst=True) obj_rdate = Field('date') obj__hash = PreHashmd5(Field('date'), Field('raw'), Field('amount')) diff --git a/modules/ing/pages/titre.py b/modules/ing/pages/titre.py index aa5913b8..d83adce9 100644 --- a/modules/ing/pages/titre.py +++ b/modules/ing/pages/titre.py @@ -70,4 +70,4 @@ class TitreHistory(HTMLPage): obj_raw = Transaction.Raw('td[4] | td[3]/a') obj_date = Date(CleanText('td[2]'), dayfirst=True) - obj_amount = CleanDecimal('td[7]') + obj_amount = CleanDecimal('td[7]', replace_dots=True) diff --git a/modules/ing/pages/transfer.py b/modules/ing/pages/transfer.py index 0ca8da6c..fc6a3914 100644 --- a/modules/ing/pages/transfer.py +++ b/modules/ing/pages/transfer.py @@ -144,7 +144,7 @@ class TransferConfirmPage(HTMLPage): class item(ItemElement): klass = Transfer - obj_amount = CleanDecimal('.//label[@id="confirmtransferAmount"]') + obj_amount = CleanDecimal('.//label[@id="confirmtransferAmount"]', replace_dots=True) obj_origin = CleanText('.//span[@id="confirmfromAccount"]') obj_recipient = CleanText('.//span[@id="confirmtoAccount"]') obj_reason = CleanText('.//span[@id="confirmtransferMotive"]') diff --git a/modules/oney/pages.py b/modules/oney/pages.py index 183de982..d9480ad1 100644 --- a/modules/oney/pages.py +++ b/modules/oney/pages.py @@ -116,7 +116,7 @@ class IndexPage(LoggedPage, HTMLPage): is_here = "//div[@id='situation']" def get_balance(self): - return -CleanDecimal('.')(self.doc.xpath('//div[@id = "total-sommes-dues"]/p[contains(text(), "sommes dues")]/span[@class = "montant"]')[0]) + return -CleanDecimal('.', replace_dots=True)(self.doc.xpath('//div[@id = "total-sommes-dues"]/p[contains(text(), "sommes dues")]/span[@class = "montant"]')[0]) class OperationsPage(LoggedPage, HTMLPage): is_here = "//div[@id='releve-reserve-credit'] | //div[@id='operations-recentes']"