| Line 601... |
Line 601... |
| 601 |
print "result", result
|
601 |
print "result", result
|
| 602 |
try:
|
602 |
try:
|
| 603 |
order1 = session.query(OrdersRaw).filter_by(id=merchantOrder['orderId']).first()
|
603 |
order1 = session.query(OrdersRaw).filter_by(id=merchantOrder['orderId']).first()
|
| 604 |
order1.status = result
|
604 |
order1.status = result
|
| 605 |
order1.rawhtml = rawHtml
|
605 |
order1.rawhtml = rawHtml
|
| - |
|
606 |
order1.order_url = url
|
| 606 |
session.commit()
|
607 |
session.commit()
|
| 607 |
except:
|
608 |
except:
|
| 608 |
traceback.print_exc()
|
609 |
traceback.print_exc()
|
| 609 |
finally:
|
610 |
finally:
|
| 610 |
session.close()
|
611 |
session.close()
|
| Line 753... |
Line 754... |
| 753 |
# if summaryFile is None:
|
754 |
# if summaryFile is None:
|
| 754 |
# print "No summary for", userId
|
755 |
# print "No summary for", userId
|
| 755 |
# else:
|
756 |
# else:
|
| 756 |
# print userId, directory+summaryFile
|
757 |
# print userId, directory+summaryFile
|
| 757 |
# store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
758 |
# store.trackOrdersForUser(userId, 'https://www.amazon.in/gp/css/order-history', readSSh(directory + summaryFile))
|
| - |
|
759 |
#"storeId":1, "status":"parse_failed", "subOrders":{"$exists":False}
|
| 758 |
for orderId in store.db.merchantOrder.find({"storeId":1, "status":"parse_failed", "subOrders":{"$exists":False}}).distinct("orderId"):
|
760 |
for order in store.db.merchantOrder.find({"storeId":1, "status":"parse_failed", "subOrders":{"$exists":False}}):
|
| 759 |
try:
|
761 |
try:
|
| - |
|
762 |
orderId=order.get("orderId")
|
| 760 |
o = session.query(OrdersRaw).filter_by(id = orderId).one()
|
763 |
o = session.query(OrdersRaw).filter_by(id = orderId).one()
|
| 761 |
store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, o.order_url)
|
764 |
store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, order['orderTrackingUrl'])
|
| 762 |
except:
|
765 |
except:
|
| 763 |
print "Could not parse", orderId
|
766 |
print "Could not parse", orderId
|
| 764 |
|
767 |
|
| 765 |
#store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
|
768 |
#store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
|
| 766 |
|
769 |
|