Subversion Repositories SmartDukaan

Rev

Rev 17368 | Rev 17465 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17368 Rev 17453
Line 437... Line 437...
437
        
437
        
438
        missingOrderUrls = []
438
        missingOrderUrls = []
439
        missingOrders = self._getMissingOrders({'userId':userId})
439
        missingOrders = self._getMissingOrders({'userId':userId})
440
        for missingOrder in missingOrders:
440
        for missingOrder in missingOrders:
441
            missingOrderUrls.append(ORDER_REDIRECT_URL%(missingOrder['merchantOrderId']))
441
            missingOrderUrls.append(ORDER_REDIRECT_URL%(missingOrder['merchantOrderId']))
442
        orders = self._getActiveOrders({'userId':userId, "subOrders.trackingUrl":{"$exists":False} })
442
        orders = self._getActiveOrders({'userId':userId})
443
        count = len(orders)
443
        count = len(orders)
444
        print "count", count
444
        print "count", count
445
        print "Missing Urls"
445
        print "Missing Urls"
446
        print "*************"
446
        print "*************"
447
        print missingOrderUrls
447
        print missingOrderUrls
Line 740... Line 740...
740
        
740
        
741
 
741
 
742
 
742
 
743
def main():
743
def main():
744
    store = getStore(1)
744
    store = getStore(1)
745
    for order in store.db.merchantOrder.find({"status":"parse_failed"}):
745
    for order in store.db.merchantOrder.find({"orderId":{"$gt":47644}, "storeId":3}):
746
        try:
746
        try:
747
            orderId=order.get("orderId")
747
            orderId=order.get("orderId")
748
            o = session.query(OrdersRaw).filter_by(id = orderId).one()
748
            o = session.query(OrdersRaw).filter_by(id = orderId).one()
749
            o.order_url = order['orderTrackingUrl']
749
            o.status = 'ORDER_CREATED'
750
            session.commit()
750
            session.commit()
751
            store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, order['orderTrackingUrl'])
-
 
752
        except:
-
 
753
            print "Could not parse", orderId
-
 
754
        finally:
751
        finally:
755
            session.close()
752
            session.close()
756
    #store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
753
    #store.trackOrdersForUser(8703, 'https://www.amazon.in/gp/css/order-history', readSSh('/home/amit/Downloads/orderSummary06-10_12_15_54'))
757
    
754
    
758
def getSummaryFile(directory):
755
def getSummaryFile(directory):