equal
deleted
inserted
replaced
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:])) |