示例#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()
示例#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()
示例#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()
示例#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()
示例#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)
示例#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()
示例#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()
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#14
0
 def init_app(self, app):
   Service.init_app(self, app)
示例#15
0
 def init_app(self, app):
     Service.init_app(self, app)
     state = app.extensions[self.name]
     state.use_cache = True
示例#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
示例#17
0
 def start(self):
     Service.start(self)
     activity.connect(self.log_activity)
示例#18
0
 def __init__(self, *args, **kwargs):
     self.__listening = False
     Service.__init__(self, *args, **kwargs)
示例#19
0
 def init_app(self, app):
     Service.init_app(self, app)
     state = app.extensions[self.name]
     state.use_cache = True
示例#20
0
 def init_app(self, app):
     Service.init_app(self, app)
示例#21
0
 def start(self):
   Service.start(self)
   activity.connect(self.log_activity)
示例#22
0
 def start(self):
     Service.start(self)
     self.register_classes()
示例#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
示例#24
0
 def stop(self):
   Service.stop(self)
   activity.disconnect(self.log_activity)
示例#25
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
示例#26
0
 def __init__(self, *args, **kwargs):
     Service.__init__(self, *args, **kwargs)
     self.adapters_cls = [SAAdapter]
     self.adapted = {}
     self.schemas = {"default": DefaultSearchSchema()}
示例#27
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
     self.init_indexes()
     self.clear_update_queue()
示例#28
0
 def start(self, **kw):
     Service.start(self)
     self.register_classes()
     self.init_indexes()
     self.clear_update_queue()
示例#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
示例#30
0
 def __init__(self, *args, **kwargs):
     self.__listening = False
     Service.__init__(self, *args, **kwargs)
示例#31
0
 def stop(self):
     Service.stop(self)
     activity.disconnect(self.log_activity)