python Programming Glossary: self._tokens
Throttling with urllib2 http://stackoverflow.com/questions/456649/throttling-with-urllib2 the bucket will be refilled. self.capacity float tokens self._tokens float tokens self.fill_rate float fill_rate self.timestamp time.time.. tokens self.tokens self.fill_rate if expected_time 0 self._tokens tokens self.lock.release return max 0 expected_time @property.. @property def tokens self self.lock.acquire if self._tokens self.capacity now time.time delta self.fill_rate now self.timestamp..
|