|
@@ -192,7 +192,7 @@ def parse_amazon(msg):
|
|
articles_text = msg_text.split('Bestellte(r) Artikel:')[1].split('_' * 10)[0].strip()
|
|
articles_text = msg_text.split('Bestellte(r) Artikel:')[1].split('_' * 10)[0].strip()
|
|
for article_text in re.split(ur'\n\t*\n', articles_text):
|
|
for article_text in re.split(ur'\n\t*\n', articles_text):
|
|
article_match = re.match(
|
|
article_match = re.match(
|
|
- ur' *(?P<name>.*)\n'
|
|
|
|
|
|
+ ur' *((?P<quantity>\d+) x )?(?P<name>.*)\n'
|
|
+ ur'( *von (?P<authors>.*)\n)?'
|
|
+ ur'( *von (?P<authors>.*)\n)?'
|
|
+ ur' *(?P<price_brutto_currency>[A-Z]+) (?P<price_brutto>\d+,\d+)\n'
|
|
+ ur' *(?P<price_brutto_currency>[A-Z]+) (?P<price_brutto>\d+,\d+)\n'
|
|
+ ur'( *Zustand: (?P<state>.*)\n)?'
|
|
+ ur'( *Zustand: (?P<state>.*)\n)?'
|
|
@@ -211,7 +211,7 @@ def parse_amazon(msg):
|
|
float(article['price_brutto'].replace(',', '.')),
|
|
float(article['price_brutto'].replace(',', '.')),
|
|
article['price_brutto_currency']
|
|
article['price_brutto_currency']
|
|
),
|
|
),
|
|
- quantity = 1,
|
|
|
|
|
|
+ quantity = int(article['quantity']) if article['quantity'] else 1,
|
|
authors = article['authors'].split(',') if article['authors'] else [],
|
|
authors = article['authors'].split(',') if article['authors'] else [],
|
|
state = article['state'],
|
|
state = article['state'],
|
|
reseller = article['reseller'],
|
|
reseller = article['reseller'],
|