| Line 501... |
Line 501... |
| 501 |
url = ORDER_TRACK_URL +'&'+ order['orderTrackingUrl'].split('trackOrder?')[1]
|
501 |
url = ORDER_TRACK_URL +'&'+ order['orderTrackingUrl'].split('trackOrder?')[1]
|
| 502 |
print url
|
502 |
print url
|
| 503 |
page = fetchResponseUsingProxy(url)
|
503 |
page = fetchResponseUsingProxy(url)
|
| 504 |
soup = BeautifulSoup(page)
|
504 |
soup = BeautifulSoup(page)
|
| 505 |
bulk = self.db.merchantOrder.initialize_ordered_bulk_op()
|
505 |
bulk = self.db.merchantOrder.initialize_ordered_bulk_op()
|
| 506 |
subbulk = self.db.merchantOrder.initialize_ordered_bulk_op()
|
- |
|
| 507 |
closed = True
|
506 |
closed = True
|
| 508 |
orderIdSpan = soup.body.find("span", {'class':'price ord_no'})
|
507 |
orderIdSpan = soup.body.find("span", {'class':'price ord_no'})
|
| 509 |
if orderIdSpan is not None:
|
508 |
if orderIdSpan is not None:
|
| 510 |
orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
|
509 |
orderStatusList = soup.findAll(attrs={'class' : 'price ord_status'})
|
| 511 |
if orderStatusList is not None and len(orderStatusList)>0:
|
510 |
if orderStatusList is not None and len(orderStatusList)>0:
|
| Line 513... |
Line 512... |
| 513 |
orderStatus = orderStatusList[0].contents[0].strip()
|
512 |
orderStatus = orderStatusList[0].contents[0].strip()
|
| 514 |
orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
|
513 |
orderTable = soup.body.find("table", {'class':'table product-list'}).findAll('tr', recursive=False)
|
| 515 |
orderTable.pop(0)
|
514 |
orderTable.pop(0)
|
| 516 |
count = 1
|
515 |
count = 1
|
| 517 |
while count <= len(orderTable):
|
516 |
while count <= len(orderTable):
|
| - |
|
517 |
subbulk = self.db.merchantOrder.initialize_ordered_bulk_op()
|
| 518 |
print 'Sub Order Id', str(subOrderId)+'-'+str(count)
|
518 |
print 'Sub Order Id', str(subOrderId)+'-'+str(count)
|
| 519 |
subOrder = self._isSubOrderActive(order, str(subOrderId)+'-'+str(count))
|
519 |
subOrder = self._isSubOrderActive(order, str(subOrderId)+'-'+str(count))
|
| 520 |
count = count +1
|
520 |
count = count +1
|
| 521 |
if subOrder is None:
|
521 |
if subOrder is None:
|
| 522 |
try:
|
522 |
try:
|