Subversion Repositories SmartDukaan

Rev

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

Rev 15212 Rev 15215
Line 27... Line 27...
27
        self.count_trials = 0
27
        self.count_trials = 0
28
        self.livePricing = livePricing
28
        self.livePricing = livePricing
29
    
29
    
30
    def read(self, url):
30
    def read(self, url):
31
        response_data = ""
31
        response_data = ""
32
        print self.livePricing
-
 
33
        try:
32
        try:
34
            response_data = fetchResponseUsingProxy(url,livePricing=self.livePricing)
33
            response_data = fetchResponseUsingProxy(url,livePricing=self.livePricing)
35
        except Exception as e:
34
        except Exception as e:
36
            print 'ERROR: ', e
35
            print 'ERROR: ', e
37
            print 'Retrying'
36
            print 'Retrying'
Line 39... Line 38...
39
            
38
            
40
            if self.count_trials < 5:
39
            if self.count_trials < 5:
41
                return self.read(url)
40
                return self.read(url)
42
        
41
        
43
        self.response_data=response_data
42
        self.response_data=response_data
44
        print response_data
-
 
45
        if "Server Busy" in self.response_data:
43
        if "Server Busy" in self.response_data:
46
            print "Server busy...Ahhhhh"
44
            print "Server busy...Ahhhhh"
47
            self.count_trials += 1
45
            self.count_trials += 1
48
            return self.read(url)
46
            return self.read(url)
49
        return self.createData()
47
        return self.createData()