Lines Matching full:bucket

32 class Bucket:  class
48 """Resets the bucket (unloads the bytecode)."""
73 raise TypeError("can't write empty bucket")
92 these methods are passed a :class:`~jinja2.bccache.Bucket`.
103 def load_bytecode(self, bucket):
104 filename = path.join(self.directory, bucket.key)
107 bucket.load_bytecode(f)
109 def dump_bytecode(self, bucket):
110 filename = path.join(self.directory, bucket.key)
112 bucket.write_bytecode(f)
118 def load_bytecode(self, bucket): argument
120 bucket. If they are not able to find code in the cache for the
121 bucket, it must not do anything.
125 def dump_bytecode(self, bucket): argument
127 from a bucket back to the cache. If it unable to do so it must not
153 """Return a cache bucket for the given template. All arguments are
158 bucket = Bucket(environment, key, checksum)
159 self.load_bytecode(bucket)
160 return bucket
162 def set_bucket(self, bucket): argument
163 """Put the bucket into the cache."""
164 self.dump_bytecode(bucket)
238 def _get_cache_filename(self, bucket): argument
239 return os.path.join(self.directory, self.pattern % (bucket.key,))
241 def load_bytecode(self, bucket): argument
242 f = open_if_exists(self._get_cache_filename(bucket), "rb")
245 bucket.load_bytecode(f)
249 def dump_bytecode(self, bucket): argument
250 f = open(self._get_cache_filename(bucket), "wb")
252 bucket.write_bytecode(f)
327 def load_bytecode(self, bucket): argument
329 code = self.client.get(self.prefix + bucket.key)
335 bucket.bytecode_from_string(code)
337 def dump_bytecode(self, bucket): argument
338 args = (self.prefix + bucket.key, bucket.bytecode_to_string())