def init_app(self, app): Service.init_app(self, app) path = app.DATA_DIR / 'files' if not path.exists(): path.mkdir(0o775) with app.app_context(): self.app_state.path = path.resolve()
def init_app(self, app): Service.init_app(self, app) path = app.DATA_DIR / "files" if not path.exists(): path.mkdir(mode=0o775, parents=True) with app.app_context(): self.app_state.path = path.resolve()
def init_app(self, app): Service.init_app(self, app) path = app.data_dir / "files" if not path.exists(): path.mkdir(mode=0o775, parents=True) with app.app_context(): self.app_state.path = path.resolve()
def init_app(self, app): login_manager.init_app(app) login_manager.login_view = 'login.login_form' Service.init_app(self, app) self.login_url_prefix = app.config.get('LOGIN_URL', '/user') app.before_request(self.do_access_control) app.before_request(self.update_user_session_data) user_logged_in.connect(self.user_logged_in, sender=app) user_logged_out.connect(self.user_logged_out, sender=app) app.register_blueprint(login_views, url_prefix=self.login_url_prefix) with app.app_context(): actions.register(*_ACTIONS)
def init_app(self, app): Service.init_app(self, app) path = Path(app.instance_path, "tmp", "files_transactions") if not path.exists(): path.mkdir(0o775, parents=True) with app.app_context(): self.app_state.path = path.resolve() if not self.__listening: self.start_listening()
def init_app(self, app): Service.init_app(self, app) path = Path(app.instance_path, 'tmp', 'files_transactions') if not path.exists(): path.mkdir(0o775, parents=True) with app.app_context(): self.app_state.path = path.resolve() if not self.__listening: self.__listening = True listen = sa.event.listen listen(Session, "after_transaction_create", self.create_transaction) listen(Session, "after_transaction_end", self.end_transaction) listen(Session, "after_begin", self.begin) listen(Session, "after_commit", self.commit) listen(Session, "after_flush", self.flush) listen(Session, "after_rollback", self.rollback)
def init_app(self, app): Service.init_app(self, app) state = app.extensions[self.name] whoosh_base = app.config.get("WHOOSH_BASE") if not whoosh_base: whoosh_base = "whoosh" # Default value if not os.path.isabs(whoosh_base): whoosh_base = os.path.join(app.instance_path, whoosh_base) state.whoosh_base = os.path.abspath(whoosh_base) if not self._listening: event.listen(Session, "after_flush", self.after_flush) event.listen(Session, "after_commit", self.after_commit) self._listening = True appcontext_pushed.connect(self.clear_update_queue, app) signals.register_js_api.connect(self._do_register_js_api)
def init_app(self, app): Service.init_app(self, app) state = app.extensions[self.name] whoosh_base = Path(app.config.get("WHOOSH_BASE", "whoosh")) if not whoosh_base.is_absolute(): whoosh_base = app.instance_path / whoosh_base if not whoosh_base.is_dir(): whoosh_base.mkdir(parents=True) state.whoosh_base = str(whoosh_base.resolve()) if not self._listening: event.listen(Session, "after_flush", self.after_flush) event.listen(Session, "after_commit", self.after_commit) self._listening = True appcontext_pushed.connect(self.clear_update_queue, app) signals.register_js_api.connect(self._do_register_js_api)
def init_app(self, app): Service.init_app(self, app) state = app.extensions[self.name] whoosh_base = Path(app.config.get("WHOOSH_BASE", "whoosh")) if not whoosh_base.is_absolute(): whoosh_base = app.instance_path / whoosh_base if not whoosh_base.is_dir(): whoosh_base.mkdir(parents=True) state.whoosh_base = text_type(whoosh_base.resolve()) if not self._listening: event.listen(Session, "after_flush", self.after_flush) event.listen(Session, "after_commit", self.after_commit) self._listening = True appcontext_pushed.connect(self.clear_update_queue, app) signals.register_js_api.connect(self._do_register_js_api)
def init_app(self, app): Service.init_app(self, app)
def init_app(self, app): Service.init_app(self, app) state = app.extensions[self.name] state.use_cache = True
def init_app(self, app): Service.init_app(self, app) if not self._listening: event.listen(Session, "after_flush", self.create_audit_entries) self._listening = True
def start(self): Service.start(self) activity.connect(self.log_activity)
def __init__(self, *args, **kwargs): self.__listening = False Service.__init__(self, *args, **kwargs)
def start(self): Service.start(self) self.register_classes()
def stop(self): Service.stop(self) activity.disconnect(self.log_activity)
def start(self, **kw): Service.start(self) self.register_classes()
def __init__(self, *args, **kwargs): Service.__init__(self, *args, **kwargs) self.adapters_cls = [SAAdapter] self.adapted = {} self.schemas = {"default": DefaultSearchSchema()}
def start(self, **kw): Service.start(self) self.register_classes() self.init_indexes() self.clear_update_queue()
def __init__(self, *args, **kwargs): Service.__init__(self, *args, **kwargs) self.adapters_cls = [SAAdapter] self.adapted = {} self.schemas = {"default": DefaultSearchSchema()} self._listening = False