web/lib/django/core/cache/__init__.py
changeset 29 cc9b7e14412b
parent 0 0d40e90630ef
equal deleted inserted replaced
28:b758351d191f 29:cc9b7e14412b
    37     Converts the "backend_uri" into a cache scheme ('db', 'memcached', etc), a
    37     Converts the "backend_uri" into a cache scheme ('db', 'memcached', etc), a
    38     host and any extra params that are required for the backend. Returns a
    38     host and any extra params that are required for the backend. Returns a
    39     (scheme, host, params) tuple.
    39     (scheme, host, params) tuple.
    40     """
    40     """
    41     if backend_uri.find(':') == -1:
    41     if backend_uri.find(':') == -1:
    42         raise InvalidCacheBackendError, "Backend URI must start with scheme://"
    42         raise InvalidCacheBackendError("Backend URI must start with scheme://")
    43     scheme, rest = backend_uri.split(':', 1)
    43     scheme, rest = backend_uri.split(':', 1)
    44     if not rest.startswith('//'):
    44     if not rest.startswith('//'):
    45         raise InvalidCacheBackendError, "Backend URI must start with scheme://"
    45         raise InvalidCacheBackendError("Backend URI must start with scheme://")
    46 
    46 
    47     host = rest[2:]
    47     host = rest[2:]
    48     qpos = rest.find('?')
    48     qpos = rest.find('?')
    49     if qpos != -1:
    49     if qpos != -1:
    50         params = dict(parse_qsl(rest[qpos+1:]))
    50         params = dict(parse_qsl(rest[qpos+1:]))