jinja2.bccache.Bucket

class jinja2.bccache.Bucket(environment, key, checksum)[source]

Buckets are used to store the bytecode for one template. It’s created and initialized by the bytecode cache and passed to the loading functions.

The buckets get an internal checksum from the cache assigned and use this to automatically reject outdated cache material. Individual bytecode cache subclasses don’t have to care about cache invalidation.

Methods

__init__(environment, key, checksum)
bytecode_from_string(string) Load bytecode from a string.
bytecode_to_string() Return the bytecode as string.
load_bytecode(f) Loads bytecode from a file or file like object.
reset() Resets the bucket (unloads the bytecode).
write_bytecode(f) Dump the bytecode into the file or file like object passed.