def __exit__(self, exc_type, exc_val, exc_tb): Log.note("clean pulse exit") self.please_stop.go() with suppress_exception: self.target_queue.close() Log.note("stop put into queue") try: self.pulse.disconnect() except Exception as e: Log.warning("Can not disconnect during pulse exit, ignoring", e) Thread.__exit__(self, exc_type, exc_val, exc_tb)
"Pulse had problem (Have you set your Pulse permissions correctly?", e) Log.note("pulse listener is done") def __exit__(self, exc_type, exc_val, exc_tb): Log.note("clean pulse exit") self.please_stop.go() with suppress_exception: self.target_queue.close() Log.note("stop put into queue") try: self.pulse.disconnect() except Exception, e: Log.warning("Can not disconnect during pulse exit, ignoring", e) Thread.__exit__(self, exc_type, exc_val, exc_tb) class Publisher(object): """ Mimic GenericPublisher https://github.com/bhearsum/mozillapulse/blob/master/mozillapulse/publishers.py """ @override def __init__( self, exchange, # name of the Pulse exchange host='pulse.mozilla.org', # url to connect, port=5671, # tcp port user=None, password=None, vhost="/",