MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / __init__

Method __init__

21-async/mojifinder/bottle.py:589–610  ·  view source on GitHub ↗
(self, catchall=True, autojson=True)

Source from the content-addressed store, hash-verified

587 """
588
589 def __init__(self, catchall=True, autojson=True):
590
591 #: A :class:`ConfigDict` for app specific configuration.
592 self.config = ConfigDict()
593 self.config._on_change = functools.partial(self.trigger_hook, 'config')
594 self.config.meta_set('autojson', 'validate', bool)
595 self.config.meta_set('catchall', 'validate', bool)
596 self.config['catchall'] = catchall
597 self.config['autojson'] = autojson
598
599 #: A :class:`ResourceManager` for application files
600 self.resources = ResourceManager()
601
602 self.routes = [] # List of installed :class:`Route` instances.
603 self.router = Router() # Maps requests to :class:`Route` instances.
604 self.error_handler = {}
605
606 # Core plugins
607 self.plugins = [] # List of installed plugins.
608 if self.config['autojson']:
609 self.install(JSONPlugin())
610 self.install(TemplatePlugin())
611
612 #: If true, most exceptions are caught and returned as :exc:`HTTPError`
613 catchall = DictProperty('config', 'catchall')

Callers

nothing calls this directly

Calls 7

installMethod · 0.95
ConfigDictClass · 0.85
ResourceManagerClass · 0.85
RouterClass · 0.85
JSONPluginClass · 0.85
TemplatePluginClass · 0.85
meta_setMethod · 0.80

Tested by

no test coverage detected