Subversion Repositories SmartDukaan

Rev

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

Rev 13770 Rev 13781
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
        try:
207
        try:
207
            br = getBrowserObject()
208
            br = getBrowserObject()
208
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
209
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
209
            response = br.open(url)
210
            response = br.open(url)
210
            page = ungzipResponse(response)
211
            page = ungzipResponse(response)
211
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)   
212
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)   
212
            self._saveToOrder(todict(merchantOrder))
213
            self._saveToOrder(todict(merchantOrder))
-
 
214
            response['result'] = 'ORDER_CREATED'
213
            return True
215
            return response
214
        except:
216
        except:
215
            print "Error occurred"
217
            print "Error occurred"
216
            traceback.print_exc()
218
            traceback.print_exc()
-
 
219
            response['result'] = 'PARSE_ERROR'
-
 
220
             
217
        
221
        
218
        return False
222
        return False
219
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
223
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
220
        #soup.find(name, attrs, recursive, text)
224
        #soup.find(name, attrs, recursive, text)
221
 
225