class documentation

Container for var files

A var file is composed of a header and any number of entries (though most have only one).

Method __bool__ No summary
Method __init__ Creates an empty var with a specified name, header, and targeted model
Method add_entry Adds an entry to this var
Method bytes No summary
Method clear Removes all entries from this var
Method get_extension Determines the file extension for a targeted model based on its contents
Method load_bytes Loads a byte string or bytestream into this file
Method save Saves this file given a filename
Method summary No summary
Method supported_by Determines whether this file supports a given model
Method targets Determines whether this file targets a given model
Instance Variable entries Undocumented
Instance Variable header Undocumented
Property checksum The checksum for the var
Property entry_length The total length of the var entries
Property is_empty Whether this var contains no entries

Inherited from TIFile:

Class Method get_type Gets the subclass corresponding to file magic if one is registered
Class Method open Creates a new file given a filename
Class Method register Registers a subtype with this class for coercion
Method __bytes__ No summary
Method __copy__ No summary
Method __eq__ Determines if two files are identical
Method __format__ Undocumented
Method __len__ No summary
Method get_filename Determines the filename based on the instance name and targeted model
Method load_file Loads this file from a file pointer
Class Variable magics Undocumented
Instance Variable name Undocumented
Method __init_subclass__ Undocumented
Class Variable _magics Undocumented

Inherited from Dock (via TIFile):

Method load Loads data into an instance by delegating to Loader methods based on the input's type
Class Variable loaders Undocumented
def __bool__(self) -> bool: (source)
Returns
boolWhether this var contains no entries
def __init__(self, *, name: str = 'UNNAMED', header: TIHeader = None, data: bytes = None): (source)

Creates an empty var with a specified name, header, and targeted model

Parameters
name:strThe name of the var (defaults to UNNAMED)
header:TIHeaderA TIHeader to attach (defaults to an empty header)
data:bytesThe var's data (defaults to empty)
def add_entry(self, entry: TIEntry = None): (source)

Adds an entry to this var

Parameters
entry:TIEntryA TIEntry to add (defaults to an empty entry)
def bytes(self) -> bytes: (source)
Returns
bytesThe bytes contained in this file
def clear(self): (source)

Removes all entries from this var

def get_extension(self, model: TIModel = TI_84PCE) -> str: (source)

Determines the file extension for a targeted model based on its contents

Parameters
model:TIModelThe model to target (defaults to this file's minimum supported model)
Returns
strThe file's extension
def load_bytes(self, data: bytes | BytesIO): (source)

Loads a byte string or bytestream into this file

Parameters
data:bytes | BytesIOThe bytes to load
def save(self, filename: str = None, *, model: TIModel = TI_84PCE): (source)

Saves this file given a filename

Parameters
filename:strA filename to save to (defaults to the file's name and extension)
model:TIModelThe model to target (defaults to TI_84PCE)
def summary(self) -> str: (source)
Returns
strA text summary of this file
def supported_by(self, model: TIModel) -> bool: (source)

Determines whether this file supports a given model

See .targets to check models this file explicitly targets.

Parameters
model:TIModelThe model to check support for
Returns
boolWhether model supports this file
def targets(self, model: TIModel) -> bool: (source)

Determines whether this file targets a given model

See .supported_by to check models this file _can_ be sent to.

Parameters
model:TIModelThe model to check as a target
Returns
boolWhether model is targeted by this file

Undocumented

Undocumented

The checksum for the var

This is equal to the lower 2 bytes of the sum of all bytes in the entries.

entry_length: int = (source)

The total length of the var entries

This should always be 57 less than the total var size.

Whether this var contains no entries