Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
:param storage_string: a string of the form method://host:port
:return: a subclass of :class:`flask_limiter.storage.Storage`

        def storage_from_string(storage_string):
    """

    :param storage_string: a string of the form method://host:port
    :return: a subclass of :class:`flask_limiter.storage.Storage`
    """
    from .storage import MemoryStorage, RedisStorage, MemcachedStorage
    parsed = urllib.parse.urlparse(storage_string)
    scheme = parsed.scheme
    if scheme == 'memory':
        return MemoryStorage()
    elif scheme == 'redis':
        return RedisStorage(storage_string)
    elif scheme == 'memcached':
        return MemcachedStorage(parsed.hostname, parsed.port or 11211)
    else:
        raise ConfigurationError("unknown storage scheme : %s" % storage_string)
        


src/f/l/Flask-Limiter-0.3.1/tests/test_storage.py   Flask-Limiter(Download)
    MovingWindowRateLimiter
 
from flask.ext.limiter.util import get_dependency, storage_from_string
from flask.ext.limiter.errors import ConfigurationError
from flask.ext.limiter.limits import PER_MINUTE, PER_SECOND