• Home
  • Raw
  • Download

Lines Matching full:bucket

37 class Bucket(object):  class
53 """Resets the bucket (unloads the bytecode)."""
78 raise TypeError("can't write empty bucket")
97 these methods are passed a :class:`~jinja2.bccache.Bucket`.
108 def load_bytecode(self, bucket):
109 filename = path.join(self.directory, bucket.key)
112 bucket.load_bytecode(f)
114 def dump_bytecode(self, bucket):
115 filename = path.join(self.directory, bucket.key)
117 bucket.write_bytecode(f)
123 def load_bytecode(self, bucket): argument
125 bucket. If they are not able to find code in the cache for the
126 bucket, it must not do anything.
130 def dump_bytecode(self, bucket): argument
132 from a bucket back to the cache. If it unable to do so it must not
158 """Return a cache bucket for the given template. All arguments are
163 bucket = Bucket(environment, key, checksum)
164 self.load_bytecode(bucket)
165 return bucket
167 def set_bucket(self, bucket): argument
168 """Put the bucket into the cache."""
169 self.dump_bytecode(bucket)
243 def _get_cache_filename(self, bucket): argument
244 return path.join(self.directory, self.pattern % bucket.key)
246 def load_bytecode(self, bucket): argument
247 f = open_if_exists(self._get_cache_filename(bucket), "rb")
250 bucket.load_bytecode(f)
254 def dump_bytecode(self, bucket): argument
255 f = open(self._get_cache_filename(bucket), "wb")
257 bucket.write_bytecode(f)
332 def load_bytecode(self, bucket): argument
334 code = self.client.get(self.prefix + bucket.key)
340 bucket.bytecode_from_string(code)
342 def dump_bytecode(self, bucket): argument
343 args = (self.prefix + bucket.key, bucket.bytecode_to_string())