Init Whoops based on App conditional rule.
771299
public function init()
    {
        if (TIGA_DEBUG == true && !$this->app->isConsole()) {
            $whoops = new \Whoops\Run();

            if ($this->app['request']->isJson()) {
                $whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler());
            } else {
                $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
            }

            $whoops->register();
        }
    }
177668
def _init_application(self, application=None):
        """"""
        if application:
            self.application = application
        else:
            self.application = self.make_application()
746260
def init_app(self, app=None):
        """"""
        config = getattr(app, 'config', app)

        self.team_id = config.get('TEAM_ID')
103845
def init_app(self, app):
        
        app.config.setdefault('FEDORA_BASE_URL', 'http://localhost:8080')
        if hasattr(app, 'teardown_appcontext'):
            app.teardown_appcontext(self.teardown)
        else:
            app.teardown_request(self.teardown)
832742
def init_config(app):
        
        app.config.setdefault('MAIL_DEBUG', app.debug)
        app.config.setdefault('MAIL_SUPPRESS_SEND', app.debug or app.testing)
1017032
def init_app(self, app):
        """"""
        app.cli.add_command(upgrader_cmd)
        app.extensions['invenio-upgrader'] = self
1173445
def init_app(self, app):
        """"""
        app.config.setdefault("SSLIFY_SUBDOMAINS", False)
        app.config.setdefault("SSLIFY_PERMANENT", False)
        app.config.setdefault("SSLIFY_SKIPS", None)

        self.hsts_include_subdomains = (
            self.hsts_include_subdomains or app.config["SSLIFY_SUBDOMAINS"]
        )
        self.permanent = self.permanent or self.app.config["SSLIFY_PERMANENT"]
        self.skip_list = self.skip_list or self.app.config["SSLIFY_SKIPS"]

        app.before_request(self.redirect_to_ssl)
        app.after_request(self.set_hsts_header)
466099
def init():
    """"""
    global app
    if app: return app
    conf.init(), db.init(conf.DbPath, conf.DbStatements)

    bottle.TEMPLATE_PATH.insert(0, conf.TemplatePath)
    app = bottle.default_app()
    bottle.BaseTemplate.defaults.update(get_url=app.get_url)
    return app
320067
def init_app(self, app, entry_point_group='invenio_previewer.previewers'):
        """"""
        self.init_config(app)
        app.register_blueprint(blueprint)
        state = _InvenioPreviewerState(
            app,
            entry_point_group=entry_point_group)
        app.extensions['invenio-previewer'] = state
        return state
103251
def init_app(kls):
    
    if not hasattr(kls, "__call__"):
        raise exceptions.MochaError("init_app: '%s' is not callable" % kls)
    Mocha._init_apps.add(kls)
    return kls
645438
def init_app(self, app):
        
        if self._route is None:
            raise TypeError(
                "route is a required argument when app is not None")

        app.rak = self
        app.add_url_rule(self._route, view_func=getattr(self, self._view_name), methods=['POST'])
681992
def init_app(self, app):
        """"""
        self.init_config(app)
        self.cache = Cache(app)
        self.is_authenticated_callback = _callback_factory(
            app.config['CACHE_IS_AUTHENTICATED_CALLBACK'])
        app.extensions['invenio-cache'] = self
815605
def init_app(self, app):
        """"""
        if self.entry_point_group:
            eps = sorted(pkg_resources.iter_entry_points(
                self.entry_point_group), key=attrgetter('name'))
            for ep in eps:
                app.logger.debug("Loading config for entry point {}".format(
                    ep))
                app.config.from_object(ep.load())
55799
def init_app(self, app, env_file=None, verbose_mode=False):
        """"""
        if self.app is None:
            self.app = app
        self.verbose_mode = verbose_mode

        if env_file is None:
            env_file = os.path.join(os.getcwd(), ".env")
        if not os.path.exists(env_file):
            warnings.warn("can't read {0} - it doesn't exist".format(env_file))
        else:
            self.__import_vars(env_file)
606087
def _init():
        '''
          
        '''
        if ApplicationLayer._isinit:
            return
        ApplicationLayer._isinit = True
        ApplicationLayer._to_app = {}
        ApplicationLayer._from_app = Queue()
417515
def init_app(self, app):
        """"""
        self.init_config(app)
        state = _OAuthClientState(app)
        app.extensions['invenio-oauthclient'] = state
        return state
1053473
protected function registerWhoops()
    {
        $whoops = new \Whoops\Run;
        $whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
        $whoops->register();
    }