コード例 #1
0
ファイル: s3.py プロジェクト: woss/Flask-Store
    def __init__(self, *args, **kwargs):
        """
        """

        if not GEVENT_INSTALLED:
            raise NotConfiguredError(
                'You must have gevent installed to use the S3GeventProvider')

        super(S3GeventProvider, self).__init__(*args, **kwargs)
コード例 #2
0
    def __init__(self, max_length=256, location=None, *args, **kwargs):
        """ Contructor, sets the location of the file relative from the
        base path.
        """

        if not SQLALCHEMY_INSTALLED:
            raise NotConfiguredError(
                'You need to install sqlalchemy to use the FlaskStoreType')

        self.location = location

        super(FlaskStoreType, self).__init__(*args, **kwargs)
        self.impl = sqlalchemy.types.Unicode(max_length)
コード例 #3
0
    def check_config(self, app):
        """ Checks the required application configuration variables are set
        in the flask application.

        Arguments
        ---------
        app : flask.app.Flask
            Flask application instance

        Raises
        ------
        NotConfiguredError
            In the event a required config parameter is required by the
            Store.
        """

        if hasattr(self.Provider, 'REQUIRED_CONFIGURATION'):
            for name in self.Provider.REQUIRED_CONFIGURATION:
                if not app.config.get(name):
                    raise NotConfiguredError(
                        '{0} must be configured in your flask application '
                        'configuration'.format(name))