Home | History | Annotate | Download | only in jinja2

Lines Matching refs:Bucket

57 class Bucket(object):
73 """Resets the bucket (unloads the bytecode)."""
93 raise TypeError('can\'t write empty bucket')
112 these methods are passed a :class:`~jinja2.bccache.Bucket`.
123 def load_bytecode(self, bucket):
124 filename = path.join(self.directory, bucket.key)
127 bucket.load_bytecode(f)
129 def dump_bytecode(self, bucket):
130 filename = path.join(self.directory, bucket.key)
132 bucket.write_bytecode(f)
138 def load_bytecode(self, bucket):
140 bucket. If they are not able to find code in the cache for the
141 bucket, it must not do anything.
145 def dump_bytecode(self, bucket):
147 from a bucket back to the cache. If it unable to do so it must not
173 """Return a cache bucket for the given template. All arguments are
178 bucket = Bucket(environment, key, checksum)
179 self.load_bytecode(bucket)
180 return bucket
182 def set_bucket(self, bucket):
183 """Put the bucket into the cache."""
184 self.dump_bytecode(bucket)
209 def _get_cache_filename(self, bucket):
210 return path.join(self.directory, self.pattern % bucket.key)
212 def load_bytecode(self, bucket):
213 f = open_if_exists(self._get_cache_filename(bucket), 'rb')
216 bucket.load_bytecode(f)
220 def dump_bytecode(self, bucket):
221 f = open(self._get_cache_filename(bucket), 'wb')
223 bucket.write_bytecode(f)
293 def load_bytecode(self, bucket):
295 code = self.client.get(self.prefix + bucket.key)
301 bucket.bytecode_from_string(code)
303 def dump_bytecode(self, bucket):
304 args = (self.prefix + bucket.key, bucket.bytecode_to_string())