##// END OF EJS Templates
Merge pull request #2599 from piti118/docstring_keyword...
Merge pull request #2599 from piti118/docstring_keyword func_kw_complete for builtin and cython with embededsignature=True using docstring better keyword completion, including docstring introspection and Cython embeddedsignature=True.

File last commit:

r9372:37f32253
r9435:918365c1 merge
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"