|
@@ -37,7 +37,7 @@ def parse(msg):
|
|
for article_text in articles_text.split('\n\n'):
|
|
for article_text in articles_text.split('\n\n'):
|
|
article_match = re.match(
|
|
article_match = re.match(
|
|
ur' *(?P<name>.*)\s'
|
|
ur' *(?P<name>.*)\s'
|
|
- + ur' *(?P<price_currency>[A-Z]+) (?P<price>\d+,\d+)\s'
|
|
|
|
|
|
+ + ur' *(?P<price_brutto_currency>[A-Z]+) (?P<price_brutto>\d+,\d+)\s'
|
|
+ ur'( *Zustand: (?P<state>.*)\s)?'
|
|
+ ur'( *Zustand: (?P<state>.*)\s)?'
|
|
+ ur' *Verkauft von: (?P<reseller>.*)',
|
|
+ ur' *Verkauft von: (?P<reseller>.*)',
|
|
article_text,
|
|
article_text,
|
|
@@ -47,7 +47,7 @@ def parse(msg):
|
|
sys.stderr.write(repr(article_text))
|
|
sys.stderr.write(repr(article_text))
|
|
raise Exception('could not match article')
|
|
raise Exception('could not match article')
|
|
article = article_match.groupdict()
|
|
article = article_match.groupdict()
|
|
- article['price'] = float(article['price'].replace(',', '.'))
|
|
|
|
|
|
+ article['price_brutto'] = float(article['price_brutto'].replace(',', '.'))
|
|
order['articles'].append(article)
|
|
order['articles'].append(article)
|
|
|
|
|
|
return order
|
|
return order
|