From a7517972b57bb7903661d9a6ab9743d194d80d54 Mon Sep 17 00:00:00 2001 From: "martin@piware.de" <> Date: Wed, 25 Oct 2006 22:49:57 +0200 Subject: [PATCH] fix for new format since Oct 2006 --- trechnung | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/trechnung b/trechnung index bd120e9..fee9774 100755 --- a/trechnung +++ b/trechnung @@ -11,6 +11,7 @@ def search_substr(f, str): return None def get_price(str): + str = str.replace(', ', ',') money_re = re.compile('^-?\d+,\d\d$') fields = str.split() fields.reverse() @@ -60,9 +61,11 @@ bill_item_re = re.compile('^\s*\d+\.\s*.*16') # Telekom assert search_substr(f, 'Summe Monatliche Beträge') -assert search_substr(f, ':::::::::::::') +assert search_substr(f, '...........') +assert search_substr(f, '...........') + for l in f: - if l.find('::::::::::::') >= 0: + if l.find('..........') >= 0: break if bill_item_re.match(l): @@ -76,6 +79,8 @@ for l in f: cur_number = l.strip() print l.strip(), ' -> switching to', cur_number +assert search_substr(f, '...........') + # other companies if search_substr(f, 'Beträge anderer Anbieter'): for l in f: -- 2.39.5