| Line 120... |
Line 120... |
| 120 |
print findMap, "\n", updateMap
|
120 |
print findMap, "\n", updateMap
|
| 121 |
bulk.find(findMap).update({'$set' : updateMap})
|
121 |
bulk.find(findMap).update({'$set' : updateMap})
|
| 122 |
closed = closed and newOrder['closed']
|
122 |
closed = closed and newOrder['closed']
|
| 123 |
if closed:
|
123 |
if closed:
|
| 124 |
print "Closed", {"orderId":merchantOrder.get("orderId")}, {"closed":True}
|
124 |
print "Closed", {"orderId":merchantOrder.get("orderId")}, {"closed":True}
|
| 125 |
bulk.find({"orderId":merchantOrder.get("orderId")}).update({"$set":{"closed":True}})
|
125 |
bulk.find({"orderId":merchantOrder.get("orderId")}).update({"$set":{"closed":True, "parseError":True}})
|
| 126 |
result = bulk.execute()
|
126 |
result = bulk.execute()
|
| 127 |
tprint(result)
|
127 |
tprint(result)
|
| 128 |
except:
|
128 |
except:
|
| 129 |
tprint("Could not update " + str(merchantOrder['orderId']))
|
129 |
tprint("Could not update " + str(merchantOrder['orderId']))
|
| - |
|
130 |
self.db.merchantOrder.update({"orderId":merchantOrder['orderId']}, {"$set":{"parseError":True}})
|
| 130 |
traceback.print_exc()
|
131 |
traceback.print_exc()
|
| 131 |
|
132 |
|
| 132 |
|
133 |
|
| 133 |
|
134 |
|
| 134 |
|
135 |
|
| Line 492... |
Line 493... |
| 492 |
# ('Accept-Encoding', 'gzip,deflate,sdch'),
|
493 |
# ('Accept-Encoding', 'gzip,deflate,sdch'),
|
| 493 |
# ('Accept-Language', 'en-US,en;q=0.8'),
|
494 |
# ('Accept-Language', 'en-US,en;q=0.8'),
|
| 494 |
# ('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.3')]
|
495 |
# ('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.3')]
|
| 495 |
# store.scrapeStoreOrders()
|
496 |
# store.scrapeStoreOrders()
|
| 496 |
#store.parseOrderRawHtml(2121, "13232", 14, readSSh("/home/amit/917.html"), "https://www.amazon.in/gp/bOy/spc/handlers/static-submit-decoupled.html/ref=ox_spc_place_order?ie=UTF8&hasWorkingJavascript=")
|
497 |
#store.parseOrderRawHtml(2121, "13232", 14, readSSh("/home/amit/917.html"), "https://www.amazon.in/gp/bOy/spc/handlers/static-submit-decoupled.html/ref=ox_spc_place_order?ie=UTF8&hasWorkingJavascript=")
|
| 497 |
#readSSh("/tmp/User157/*")
|
498 |
readSSh("/tmp/User211/2015-04-01 15:31:42.250309")
|
| 498 |
store.scrapeAffiliate()
|
499 |
store.scrapeAffiliate()
|
| 499 |
def readSSh(fileName):
|
500 |
def readSSh(fileName):
|
| 500 |
try:
|
501 |
try:
|
| 501 |
str1 = open(fileName).read()
|
502 |
str1 = open(fileName).read()
|
| 502 |
return str1
|
503 |
return str1
|