예제 #1
0
def init(config: pyramid.config.Configurator) -> None:
    """
    Install a pyramid  event handler that adds the request information
    """
    if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
        from . import _impl
        _impl.init(config)
예제 #2
0
def includeme(config: pyramid.config.Configurator) -> None:
    """Initialize the debug tools."""
    if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
        from c2cwsgiutils.debug import _views

        init_daemon(config)
        _views.init(config)
def includeme(config: pyramid.config.Configurator) -> None:
    """Install the view to configure the loggers, if configured to do so."""
    if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
        config.add_route(
            "c2c_db_maintenance",
            config_utils.get_base_path(config) + r"/db/maintenance",
            request_method="GET",
        )
        config.add_view(_db_maintenance, route_name="c2c_db_maintenance", renderer="fast_json", http_cache=0)
        _restore(config)
        LOG.info("Enabled the /db/maintenance API")
예제 #4
0
def includeme(config: pyramid.config.Configurator) -> None:
    """Install the view to configure the loggers, if configured to do so."""
    if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
        config.add_route("c2c_logging_level",
                         config_utils.get_base_path(config) +
                         r"/logging/level",
                         request_method="GET")
        config.add_view(_logging_change_level,
                        route_name="c2c_logging_level",
                        renderer="fast_json",
                        http_cache=0)
        _restore_overrides(config)
        LOG.info("Enabled the /logging/level API")
예제 #5
0
def init(config: pyramid.config.Configurator) -> None:
    if auth.is_enabled(config, ENV_KEY, CONFIG_KEY):
        from . import _views
        init_daemon(config)
        _views.init(config)