Beispiel #1
0
  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()
Beispiel #2
0
    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()
Beispiel #3
0
    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()
Beispiel #4
0
    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()
Beispiel #5
0
 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)
Beispiel #6
0
    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()
Beispiel #7
0
    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()
Beispiel #8
0
 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)
Beispiel #9
0
  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)
Beispiel #10
0
    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)
Beispiel #11
0
    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)
Beispiel #12
0
    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)
Beispiel #13
0
    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)
Beispiel #14
0
 def init_app(self, app):
   Service.init_app(self, app)
Beispiel #15
0
 def init_app(self, app):
     Service.init_app(self, app)
     state = app.extensions[self.name]
     state.use_cache = True
Beispiel #16
0
    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
Beispiel #17
0
 def start(self):
     Service.start(self)
     activity.connect(self.log_activity)
Beispiel #18
0
 def __init__(self, *args, **kwargs):
     self.__listening = False
     Service.__init__(self, *args, **kwargs)
Beispiel #19
0
 def init_app(self, app):
     Service.init_app(self, app)
     state = app.extensions[self.name]
     state.use_cache = True
Beispiel #20
0
 def init_app(self, app):
     Service.init_app(self, app)
Beispiel #21
0
 def start(self):
   Service.start(self)
   activity.connect(self.log_activity)
Beispiel #22
0
 def start(self):
     Service.start(self)
     self.register_classes()
Beispiel #23
0
    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
Beispiel #24
0
 def stop(self):
   Service.stop(self)
   activity.disconnect(self.log_activity)
Beispiel #25
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
Beispiel #26
0
 def __init__(self, *args, **kwargs):
     Service.__init__(self, *args, **kwargs)
     self.adapters_cls = [SAAdapter]
     self.adapted = {}
     self.schemas = {"default": DefaultSearchSchema()}
Beispiel #27
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
     self.init_indexes()
     self.clear_update_queue()
Beispiel #28
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
     self.init_indexes()
     self.clear_update_queue()
Beispiel #29
0
 def __init__(self, *args, **kwargs):
     Service.__init__(self, *args, **kwargs)
     self.adapters_cls = [SAAdapter]
     self.adapted = {}
     self.schemas = {"default": DefaultSearchSchema()}
     self._listening = False
Beispiel #30
0
 def __init__(self, *args, **kwargs):
     self.__listening = False
     Service.__init__(self, *args, **kwargs)
Beispiel #31
0
 def stop(self):
     Service.stop(self)
     activity.disconnect(self.log_activity)