(self, app, expires=None, backend=None,
options=None, url=None, **kwargs)
| 200 | implements_incr = True |
| 201 | |
| 202 | def __init__(self, app, expires=None, backend=None, |
| 203 | options=None, url=None, **kwargs): |
| 204 | options = {} if not options else options |
| 205 | super().__init__(app, **kwargs) |
| 206 | self.url = url |
| 207 | |
| 208 | self.options = dict(self.app.conf.cache_backend_options, |
| 209 | **options) |
| 210 | |
| 211 | self.backend = url or backend or self.app.conf.cache_backend |
| 212 | if self.backend: |
| 213 | self.backend, _, servers = self.backend.partition('://') |
| 214 | self.servers = servers.rstrip('/').split(';') |
| 215 | self.expires = self.prepare_expires(expires, type=int) |
| 216 | try: |
| 217 | self.Client, self.key_t = backends[self.backend]() |
| 218 | except KeyError: |
| 219 | raise ImproperlyConfigured(UNKNOWN_BACKEND.format( |
| 220 | self.backend, ', '.join(backends))) |
| 221 | self._encode_prefixes() # rencode the keyprefixes |
| 222 | if (self._chord_expires is not None |
| 223 | and self.chord_expires > MAX_RELATIVE_EXPIRES): |
| 224 | logger.warning(W_CHORD_EXPIRES_TOO_LONG) |
| 225 | |
| 226 | def get(self, key): |
| 227 | return self.client.get(key) |
nothing calls this directly
no test coverage detected