Bucket Class

Inheritance diagram of Bucket

class Bucket(environment, key, checksum)

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.

Descriptions

class Bucket

Method details

__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.

Table Of Contents

Previous topic

sha1

Next topic

BytecodeCache Class