• Home
  • Raw
  • Download

Lines Matching full:bucket

44 class Bucket:  class
60 """Resets the bucket (unloads the bytecode)."""
85 raise TypeError("can't write empty bucket")
104 these methods are passed a :class:`~jinja2.bccache.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: argument
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: argument
139 from a bucket back to the cache. If it unable to do so it must not
171 ) -> Bucket:
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: argument
182 """Put the bucket into the cache."""
183 self.dump_bytecode(bucket)
259 def _get_cache_filename(self, bucket: Bucket) -> str: argument
260 return os.path.join(self.directory, self.pattern % (bucket.key,))
262 def load_bytecode(self, bucket: Bucket) -> None: argument
263 filename = self._get_cache_filename(bucket)
275 bucket.load_bytecode(f)
277 def dump_bytecode(self, bucket: Bucket) -> None: argument
281 name = self._get_cache_filename(bucket)
300 bucket.write_bytecode(f)
386 def load_bytecode(self, bucket: Bucket) -> None: argument
388 code = self.client.get(self.prefix + bucket.key)
393 bucket.bytecode_from_string(code)
395 def dump_bytecode(self, bucket: Bucket) -> None: argument
396 key = self.prefix + bucket.key
397 value = bucket.bytecode_to_string()