Lines Matching refs:bucket
60 """Resets the bucket (unloads the bytecode)."""
85 raise TypeError("can't write empty bucket")
115 def load_bytecode(self, bucket):
116 filename = path.join(self.directory, bucket.key)
119 bucket.load_bytecode(f)
121 def dump_bytecode(self, bucket):
122 filename = path.join(self.directory, bucket.key)
124 bucket.write_bytecode(f)
130 def load_bytecode(self, bucket: Bucket) -> None:
132 bucket. If they are not able to find code in the cache for the
133 bucket, it must not do anything.
137 def dump_bytecode(self, bucket: Bucket) -> None:
139 from a bucket back to the cache. If it unable to do so it must not
172 """Return a cache bucket for the given template. All arguments are
177 bucket = Bucket(environment, key, checksum)
178 self.load_bytecode(bucket)
179 return bucket
181 def set_bucket(self, bucket: Bucket) -> None:
182 """Put the bucket into the cache."""
183 self.dump_bytecode(bucket)
259 def _get_cache_filename(self, bucket: Bucket) -> str:
260 return os.path.join(self.directory, self.pattern % (bucket.key,))
262 def load_bytecode(self, bucket: Bucket) -> None:
263 filename = self._get_cache_filename(bucket)
275 bucket.load_bytecode(f)
277 def dump_bytecode(self, bucket: Bucket) -> None:
281 name = self._get_cache_filename(bucket)
300 bucket.write_bytecode(f)
386 def load_bytecode(self, bucket: Bucket) -> None:
388 code = self.client.get(self.prefix + bucket.key)
393 bucket.bytecode_from_string(code)
395 def dump_bytecode(self, bucket: Bucket) -> None:
396 key = self.prefix + bucket.key
397 value = bucket.bytecode_to_string()