~muelnet/heybuddy/remote_users

« back to all changes in this revision

Viewing changes to heybuddy.py

  • Committer: samsnotunix at gmail
  • Date: 2011-02-16 18:50:42 UTC
  • Revision ID: samsnotunix@gmail.com-20110216185042-2h5kwazvsny29dw2
Fixed bug with int casting in pruning. When self.dent_limit is set in heybuddy.py it is set as self.initial_dent*2.
Since the configuration module in python returns everything as a string self.initial_dent*2 would give a result of
'3030' if initial_dent=30 for instance. So when pruning happened it pruned against 3030 instead of 60. Fixed
by casting self.initial_dent to int when setting dent_limit

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
                self.regex_url=re.compile("(http[s]?://.*?)(\s|$)",re.IGNORECASE)
126
126
                #get the initial dents
127
127
                self.initial_dents = self.conf.get('settings','initial_dents',default='20' )
128
 
                self.dent_limit = self.initial_dents*2
 
128
                self.dent_limit = int(self.initial_dents)*2
129
129
                #get the pull time
130
130
                self.pull_time = self.conf.get('settings','pull_time',default='60')
131
131
                self.pull_time_changed_bool = False
379
379
        def get_direct_messages(self):
380
380
                if self.credentials_verified:
381
381
                        now = time.time()
382
 
                        #NOTE this could be changed to 3 minutes just setting it this way
383
 
                        #for now
 
382
                        #NOTE this could be changed to 3 minutes just setting it 
 
383
                        #this way for now
384
384
                        #has it been 3 times the pull time?
385
385
                        if now - (3 * int(self.pull_time) ) > self.last_direct_message_time:
386
386
                                self.increment_requests()
931
931
                
932
932
        def set_initial_dents(self,widget,value):
933
933
                self.initial_dents=value
934
 
                self.dent_limit = self.initial_dents*2
 
934
                self.dent_limit = int(self.initial_dents)*2
935
935
                self.conf.set('settings','initial_dents',value)
936
936
                
937
937