whitespace and linelen cleanup
This commit is contained in:
@@ -27,7 +27,8 @@ class Semaphore(object):
|
|||||||
self._waiters = set()
|
self._waiters = set()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
params = (self.__class__.__name__, hex(id(self)), self.counter, len(self._waiters))
|
params = (self.__class__.__name__, hex(id(self)),
|
||||||
|
self.counter, len(self._waiters))
|
||||||
return '<%s at %s c=%s _w[%s]>' % params
|
return '<%s at %s c=%s _w[%s]>' % params
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
@@ -35,11 +36,12 @@ class Semaphore(object):
|
|||||||
return '<%s c=%s _w[%s]>' % params
|
return '<%s c=%s _w[%s]>' % params
|
||||||
|
|
||||||
def locked(self):
|
def locked(self):
|
||||||
""" Returns true if a call to acquire would block."""
|
"""Returns true if a call to acquire would block."""
|
||||||
return self.counter <= 0
|
return self.counter <= 0
|
||||||
|
|
||||||
def bounded(self):
|
def bounded(self):
|
||||||
""" Returns False; for consistency with :class:`~eventlet.semaphore.CappedSemaphore`."""
|
"""Returns False; for consistency with
|
||||||
|
:class:`~eventlet.semaphore.CappedSemaphore`."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def acquire(self, blocking=True):
|
def acquire(self, blocking=True):
|
||||||
@@ -167,11 +169,13 @@ class CappedSemaphore(object):
|
|||||||
self.upper_bound = Semaphore(limit-count)
|
self.upper_bound = Semaphore(limit-count)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
params = (self.__class__.__name__, hex(id(self)), self.balance, self.lower_bound, self.upper_bound)
|
params = (self.__class__.__name__, hex(id(self)),
|
||||||
|
self.balance, self.lower_bound, self.upper_bound)
|
||||||
return '<%s at %s b=%s l=%s u=%s>' % params
|
return '<%s at %s b=%s l=%s u=%s>' % params
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
params = (self.__class__.__name__, self.balance, self.lower_bound, self.upper_bound)
|
params = (self.__class__.__name__, self.balance,
|
||||||
|
self.lower_bound, self.upper_bound)
|
||||||
return '<%s b=%s l=%s u=%s>' % params
|
return '<%s b=%s l=%s u=%s>' % params
|
||||||
|
|
||||||
def locked(self):
|
def locked(self):
|
||||||
|
Reference in New Issue
Block a user