(self, app, expires=None, backend=None,
options=None, url=None, **kwargs)
| 96 | implements_incr = True |
| 97 | |
| 98 | def __init__(self, app, expires=None, backend=None, |
| 99 | options=None, url=None, **kwargs): |
| 100 | options = {} if not options else options |
| 101 | super().__init__(app, **kwargs) |
| 102 | self.url = url |
| 103 | |
| 104 | self.options = dict(self.app.conf.cache_backend_options, |
| 105 | **options) |
| 106 | |
| 107 | self.backend = url or backend or self.app.conf.cache_backend |
| 108 | if self.backend: |
| 109 | self.backend, _, servers = self.backend.partition('://') |
| 110 | self.servers = servers.rstrip('/').split(';') |
| 111 | self.expires = self.prepare_expires(expires, type=int) |
| 112 | try: |
| 113 | self.Client, self.key_t = backends[self.backend]() |
| 114 | except KeyError: |
| 115 | raise ImproperlyConfigured(UNKNOWN_BACKEND.format( |
| 116 | self.backend, ', '.join(backends))) |
| 117 | self._encode_prefixes() # rencode the keyprefixes |
| 118 | |
| 119 | def get(self, key): |
| 120 | return self.client.get(key) |
nothing calls this directly
no test coverage detected