class documentation

class Bucket: (source)

View In Hierarchy

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.

Method __init__ Undocumented
Method bytecode_from_string Load bytecode from bytes.
Method bytecode_to_string Return the bytecode as bytes.
Method load_bytecode Loads bytecode from a file or file like object.
Method reset Resets the bucket (unloads the bytecode).
Method write_bytecode Dump the bytecode into the file or file like object passed.
Instance Variable checksum Undocumented
Instance Variable code Undocumented
Instance Variable environment Undocumented
Instance Variable key Undocumented
def __init__(self, environment, key, checksum): (source)

Undocumented

Parameters
environment:EnvironmentUndocumented
key:strUndocumented
checksum:strUndocumented
def bytecode_from_string(self, string): (source)

Load bytecode from bytes.

Parameters
string:bytesUndocumented
def bytecode_to_string(self): (source)

Return the bytecode as bytes.

Returns
bytesUndocumented
def load_bytecode(self, f): (source)

Loads bytecode from a file or file like object.

Parameters
f:t.BinaryIOUndocumented
def reset(self): (source)

Resets the bucket (unloads the bytecode).

def write_bytecode(self, f): (source)

Dump the bytecode into the file or file like object passed.

Parameters
f:t.IO[bytes]Undocumented
checksum = (source)

Undocumented

code = (source)

Undocumented

environment = (source)

Undocumented

Undocumented