def __init__(self, debug=False):
"""
Constructor of the Application.
:param debug: Sets the logging level of the application
:raises NotImplementedError: When ``Application.base_title``
not set in the class definition.
"""
self.debug = debug
loglevel = logging.DEBUG if debug else logging.WARNING
logging.basicConfig(
format='%(asctime)s - [%(levelname)s] %(message)s', datefmt='%I:%M:%S %p', level=loglevel)
self.processor = EventProcessor()
self.server = EventServer(processor=self.processor)
if self.base_title is None:
raise NotImplementedError
self.services = {}
self.views = {}
self.current_view = None
self.register('init', lambda evt,
interface: self._load_view('default'))
评论列表
文章目录