##// END OF EJS Templates
Merge Security Pull Request: google-caja...
Merge Security Pull Request: google-caja Adds HTML sanitization. The basics: - untrusted HTML is always sanitized, with no warning (there is console logging for changes made) - markdown is always treated as untrusted - no warnings for simply excluded output (e.g. Javascript) - CSS tags and attributes are always stripped from untrusted HTML - never check whether HTML is "safe," only sanitize - add 'Trust notebook' to File menu

File last commit:

r11130:de5468b5
r15674:f33c5e99 merge
Show More
log.py
21 lines | 661 B | text/x-python | PythonLexer
from logging import INFO, DEBUG, WARN, ERROR, FATAL
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"