|
@@ -38,10 +38,14 @@ def parse(msg):
|
|
|
article_match = re.match(
|
|
|
ur' *(?P<name>.*)\s'
|
|
|
+ ur' *(?P<price_currency>[A-Z]+) (?P<price>\d+,\d+)\s'
|
|
|
+ + ur'( *Zustand: (?P<state>.*)\s)?'
|
|
|
+ ur' *Verkauft von: (?P<reseller>.*)',
|
|
|
article_text,
|
|
|
re.MULTILINE | re.UNICODE
|
|
|
)
|
|
|
+ if article_match is None:
|
|
|
+ sys.stderr.write(repr(article_text))
|
|
|
+ raise Exception('could not match article')
|
|
|
article = article_match.groupdict()
|
|
|
article['price'] = float(article['price'].replace(',', '.'))
|
|
|
order['articles'].append(article)
|