|
@@ -51,11 +51,13 @@ def parse_order_confirmation_mail(mail):
|
|
reward = reward_label_tag.findNext().text if reward_label_tag else None,
|
|
reward = reward_label_tag.findNext().text if reward_label_tag else None,
|
|
))
|
|
))
|
|
|
|
|
|
- shipping_costs_label_tag = doc.find(text = re.compile(u'Versand:'))
|
|
+ shipping_costs_label_tag = doc.find(text = re.compile(u'(Versand|Shipping):'))
|
|
if shipping_costs_label_tag:
|
|
if shipping_costs_label_tag:
|
|
- with ioex.setlocale('de_AT.utf8'):
|
|
+ with ioex.setlocale('de_AT.utf8' if 'Versand' in shipping_costs_label_tag else 'en_US.utf8'):
|
|
estimated_arrival_start = datetime.datetime.strptime(
|
|
estimated_arrival_start = datetime.datetime.strptime(
|
|
- doc.find(text = re.compile('Voraussichtliche Lieferung:')).findNext().text,
|
|
+ doc.find(
|
|
|
|
+ text = re.compile('(Voraussichtliche Lieferung|Estimated Delivery):')
|
|
|
|
+ ).findNext().text,
|
|
'%B %Y'
|
|
'%B %Y'
|
|
).replace(tzinfo = email_date.tzinfo)
|
|
).replace(tzinfo = email_date.tzinfo)
|
|
order.items.append(dingguo.Shipping(
|
|
order.items.append(dingguo.Shipping(
|
|
@@ -66,7 +68,7 @@ def parse_order_confirmation_mail(mail):
|
|
start = estimated_arrival_start,
|
|
start = estimated_arrival_start,
|
|
end = (estimated_arrival_start + datetime.timedelta(days = 32)).replace(day = 1),
|
|
end = (estimated_arrival_start + datetime.timedelta(days = 32)).replace(day = 1),
|
|
),
|
|
),
|
|
- destination_point = doc.find(text = re.compile('Lieferadresse:'))
|
|
+ destination_point = doc.find(text = re.compile('(Lieferadresse|Shipping Address):'))
|
|
.findNext().text.replace('\r\n', '\n'),
|
|
.findNext().text.replace('\r\n', '\n'),
|
|
))
|
|
))
|
|
|
|
|