class documentation

class Bucket:

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 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 code Undocumented
Instance Variable environment Undocumented
Instance Variable key Undocumented
Method __init__ Undocumented
Instance Variable checksum Undocumented
def bytecode_from_string(self, string):
Load bytecode from bytes.
Parameters
string:bytesUndocumented
def bytecode_to_string(self):
Return the bytecode as bytes.
Returns
bytesUndocumented
def load_bytecode(self, f):
Loads bytecode from a file or file like object.
Parameters
f:t.BinaryIOUndocumented
def reset(self):
Resets the bucket (unloads the bytecode).
def write_bytecode(self, f):
Dump the bytecode into the file or file like object passed.
Parameters
f:t.BinaryIOUndocumented
code =

Undocumented

environment =

Undocumented

key =

Undocumented

def __init__(self, environment, key, checksum):

Undocumented

Parameters
environment:EnvironmentUndocumented
key:strUndocumented
checksum:strUndocumented
checksum =

Undocumented