Subversion Repositories SmartDukaan

Rev

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

Rev 17641 Rev 17665
Line 123... Line 123...
123
                soup = BeautifulSoup(rawHtml)
123
                soup = BeautifulSoup(rawHtml)
124
                if not soup.body:
124
                if not soup.body:
125
                    resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
125
                    resp['result'] = 'DETAIL_NOT_CREATED_KNOWN'
126
                else:   
126
                else:   
127
                    try:
127
                    try:
-
 
128
                        print "soup.prettify()"
-
 
129
                        print soup.prettify()
128
                        self.parseNewStlye(merchantOrder, soup)
130
                        self.parseNewStlye(merchantOrder, soup)
129
                        resp['result'] = 'DETAIL_CREATED'
131
                        resp['result'] = 'DETAIL_CREATED'
130
                    except:
132
                    except:
131
                        try:
133
                        try:
132
                            traceback.print_exc()
134
                            traceback.print_exc()
Line 767... Line 769...
767
 
769
 
768
 
770
 
769
def main():
771
def main():
770
    store = getStore(1)
772
    store = getStore(1)
771
    #[59433, 59472, 59487, 59503, 59545, 59549, 59573, 59591]
773
    #[59433, 59472, 59487, 59503, 59545, 59549, 59573, 59591]
772
    for orderId in [59591]:
774
    for orderId in [60198]:
773
        try:
775
        try:
774
            o = session.query(OrdersRaw).filter_by(id = orderId).one()
776
            o = session.query(OrdersRaw).filter_by(id = orderId).one()
775
            store.trackOrdersForUser(o.id, o.order_url, o.rawhtml)
777
            store.parseOrderRawHtml(o.id, o.sub_tag, o.user_id, o.rawhtml, o.order_url)
776
        finally:
778
        finally:
777
            session.close()
779
            session.close()
778
    #store.trackOrdersForUser(10466, 'https://www.amazon.in/gp/css/summary/edit.html?orderID=403-7498756-0837158', readSSh('/AmazonTrack/User10466/403-7498756-0837158'))
780
    #store.trackOrdersForUser(10466, 'https://www.amazon.in/gp/css/summary/edit.html?orderID=403-7498756-0837158', readSSh('/AmazonTrack/User10466/403-7498756-0837158'))
779
    #store.trackOrdersForUser(9031, 'https://www.amazon.in/gp/css/summary/edit.html?orderID=403-0812780-9465164', readSSh('/home/amit/sample.html'))
781
    #store.trackOrdersForUser(9031, 'https://www.amazon.in/gp/css/summary/edit.html?orderID=403-0812780-9465164', readSSh('/home/amit/sample.html'))
780
    
782
    
Line 887... Line 889...
887
        session.close()
889
        session.close()
888
    
890
    
889
if __name__ == '__main__':
891
if __name__ == '__main__':
890
#    readSSh("/AmazonTrack/User2942/402-2467356-7564367")
892
#    readSSh("/AmazonTrack/User2942/402-2467356-7564367")
891
#    readSSh("/AmazonTrack/User10466/orderSummary18-11:21:32:36")
893
#    readSSh("/AmazonTrack/User10466/orderSummary18-11:21:32:36")
892
#    readSSh("/AmazonTrack/User10466/403-7498756-0837158")
894
    #readSSh("/AmazonTrack/User2482/orderSummary20-11:09:17:47")
893
    main()
895
    main()
894
896