Subversion Repositories SmartDukaan

Rev

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

Rev 13791 Rev 13796
Line 201... Line 201...
201
                    subOrder.trackingNumber = line.split(":")[1].strip()
201
                    subOrder.trackingNumber = line.split(":")[1].strip()
202
            return subOrder
202
            return subOrder
203
 
203
 
204
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl):
204
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl):
205
                    #print merchantOrder
205
                    #print merchantOrder
206
        response = {}
206
        resp = {}
207
        try:
207
        try:
208
            br = getBrowserObject()
208
            br = getBrowserObject()
209
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
209
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
210
            page = br.open(url)
210
            page = br.open(url)
211
            page = ungzipResponse(page)
211
            page = ungzipResponse(page)
212
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)   
212
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)   
213
            self._saveToOrder(todict(merchantOrder))
213
            self._saveToOrder(todict(merchantOrder))
214
            response['result'] = 'ORDER_CREATED'
214
            resp['result'] = 'ORDER_CREATED'
215
            return response
215
            return resp
216
        except:
216
        except:
217
            print "Error occurred"
217
            print "Error occurred"
218
            traceback.print_exc()
218
            traceback.print_exc()
219
            response['result'] = 'PARSE_ERROR'
219
            resp['result'] = 'PARSE_ERROR'
220
            return response
220
            return resp
221
             
221
             
222
        
222
        
223
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
223
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
224
        #soup.find(name, attrs, recursive, text)
224
        #soup.find(name, attrs, recursive, text)
225
 
225