##// END OF EJS Templates
Fix bugs in completer.py with incompletely-implemented property....
Fix bugs in completer.py with incompletely-implemented property. From a docstring that ended mid-sentence, it's pretty clear that we'd forgotten to finish the implementation of the completion splitter with real properties. I have no clue how the tests were passing, as there was also a nasty bit of state mangling being done by one of the tests; finished the implementation and fixed the tests.

File last commit:

r3603:600411fc
r6945:b1c2e302
Show More
log.py
23 lines | 687 B | text/x-python | PythonLexer
import logging
from logging import INFO, DEBUG, WARN, ERROR, FATAL
import zmq
from zmq.log.handlers import PUBHandler
class EnginePUBHandler(PUBHandler):
"""A simple PUBHandler subclass that sets root_topic"""
engine=None
def __init__(self, engine, *args, **kwargs):
PUBHandler.__init__(self,*args, **kwargs)
self.engine = engine
@property
def root_topic(self):
"""this is a property, in case the handler is created
before the engine gets registered with an id"""
if isinstance(getattr(self.engine, 'id', None), int):
return "engine.%i"%self.engine.id
else:
return "engine"