cc-4105: added docstrings and fixed code formatting

This commit is contained in:
Rudi Grinberg 2012-08-14 15:33:32 -04:00
parent a73d0940bd
commit 0b872afe59
2 changed files with 13 additions and 6 deletions

View file

@ -9,11 +9,11 @@ class EventDrainer(Loggable):
"""
def __init__(self, connection, interval=1):
def cb():
try: connection.drain_events(timeout=0.3)
except socket.timeout: pass
except Exception as e:
self.logger.error("Error flushing events")
self.logger.error( str(e) )
t = RepeatTimer(interval, cb)
try : connection.drain_events(timeout=0.3)
except socket.timeout : pass
except Exception as e :
self.fatal_exception("Error flushing events", e)
t = RepeatTimer(interval, cb)
t.daemon = True
t.start()