• Home
  • Raw
  • Download

Lines Matching full:bucket

60 class Bucket(object):  class
76 """Resets the bucket (unloads the bytecode)."""
101 raise TypeError('can\'t write empty bucket')
120 these methods are passed a :class:`~jinja2.bccache.Bucket`.
131 def load_bytecode(self, bucket):
132 filename = path.join(self.directory, bucket.key)
135 bucket.load_bytecode(f)
137 def dump_bytecode(self, bucket):
138 filename = path.join(self.directory, bucket.key)
140 bucket.write_bytecode(f)
146 def load_bytecode(self, bucket): argument
148 bucket. If they are not able to find code in the cache for the
149 bucket, it must not do anything.
153 def dump_bytecode(self, bucket): argument
155 from a bucket back to the cache. If it unable to do so it must not
181 """Return a cache bucket for the given template. All arguments are
186 bucket = Bucket(environment, key, checksum)
187 self.load_bytecode(bucket)
188 return bucket
190 def set_bucket(self, bucket): argument
191 """Put the bucket into the cache."""
192 self.dump_bytecode(bucket)
260 def _get_cache_filename(self, bucket): argument
261 return path.join(self.directory, self.pattern % bucket.key)
263 def load_bytecode(self, bucket): argument
264 f = open_if_exists(self._get_cache_filename(bucket), 'rb')
267 bucket.load_bytecode(f)
271 def dump_bytecode(self, bucket): argument
272 f = open(self._get_cache_filename(bucket), 'wb')
274 bucket.write_bytecode(f)
344 def load_bytecode(self, bucket): argument
346 code = self.client.get(self.prefix + bucket.key)
352 bucket.bytecode_from_string(code)
354 def dump_bytecode(self, bucket): argument
355 args = (self.prefix + bucket.key, bucket.bytecode_to_string())