class TIComponent(Dock, Converter): (source)
Known subclasses: tivars.flash.TIFlashHeader, tivars.var.TIEntry
Constructor: TIComponent(init, name, data)
Base class for data components of TI files
The subclasses of TIComponent are TIEntry (for var files) and TIFlashHeader (for flash files).
Note that TIHeader is not a TIComponent due to not having proper attached data.
| Class | |
Raw bytes container for this component |
| Class Method | get |
Converts bytes -> TIComponent |
| Class Method | get |
Gets the subclass corresponding to a type ID, type name, or file extension if one is registered |
| Class Method | open |
Creates a new component from a file given a filename |
| Class Method | register |
Registers a subtype with this class for coercion |
| Class Method | set |
Converts TIComponent -> bytes |
| Method | __bool__ |
No summary |
| Method | __bytes__ |
No summary |
| Method | __copy__ |
No summary |
| Method | __eq__ |
Determines if two components are the same type and have the same bytes |
| Method | __format__ |
Undocumented |
| Method | __init__ |
Creates an empty component with specified data |
| Method | __len__ |
No summary |
| Method | __str__ |
No summary |
| Method | bytes |
No summary |
| Method | calc |
The data section of the component which is loaded on-calc |
| Method | clear |
Clears this component's data |
| Method | coerce |
Coerces this component to a subclass if possible using the component's type ID |
| Method | data |
The component's user data |
| Method | dict |
No summary |
| Method | get |
Determines the file extension for a targeted model based on its contents |
| Method | json |
No summary |
| Method | load |
Loads a byte string or bytestream into this component |
| Method | load |
Loads this component from a JSON dictionary representation |
| Method | load |
Loads this component from a file given a file pointer and offset |
| Method | load |
Loads this component from a JSON dictionary representation |
| Method | load |
Loads this component from a string representation |
| Method | name |
The name of the component |
| Method | save |
Saves this component as a complete file in the current directory given a filename and optional targeted model |
| Method | string |
No summary |
| Method | summary |
No summary |
| Method | type |
The (first) type ID of the component |
| Method | update |
Updates this component's metadata |
| Property | is |
Whether this component's data is empty |
| Class Variable | _type |
Undocumented |
| Class Variable | _type |
Undocumented |
Inherited from Dock:
| Method | load |
Loads data into an instance by delegating to Loader methods based on the input's type |
| Class Variable | loaders |
Undocumented |
tivars.data.Converter.getConverts bytes -> TIComponent
| Parameters | |
data:bytes | The raw bytes to convert |
| **kwargs | Undocumented |
| Returns | |
Self | A TIComponent instance with data equal to data |
int = None, name: str = None, extension: str = None) -> type[ Self] | None:
(source)
¶
tivars.flash.TIFlashHeader, tivars.var.TIEntryGets the subclass corresponding to a type ID, type name, or file extension if one is registered
| Parameters | |
typeint | The type ID to search by, or |
name:str | The type name to search by, or |
extension:str | The file extension to search by |
| Returns | |
type[ | A subclass of this component with corresponding type ID or extension, or None |
tivars.flash.TIFlashHeader, tivars.var.TIEntryCreates a new component from a file given a filename
| Parameters | |
filename:str | A filename to open |
| Returns | |
Self | The (first) component stored in the file |
tivars.data.Converter.setConverts TIComponent -> bytes
| Parameters | |
value:Self | The value to convert |
| **kwargs | Undocumented |
| Returns | |
bytes | The data of value |
Determines if two components are the same type and have the same bytes
| Parameters | |
| other | The component to check against |
| Returns | |
bool | Whether this component is equal to other |
tivars.flash.TIFlashHeader, tivars.var.TIEntry| Returns | |
int | The total length of this component's bytes |
tivars.flash.TIFlashHeader, tivars.var.TIEntry| Returns | |
bytes | The bytes contained in this component |
tivars.flash.TIFlashHeader, tivars.types.complex.ComplexEntry, tivars.types.list.TIList, tivars.types.matrix.TIMatrix, tivars.types.real.RealEntry, tivars.var.SizedEntryThe data section of the component which is loaded on-calc
tivars.types.complex.ComplexEntry, tivars.types.gdb.TIGraphedEquation, tivars.types.gdb.TIMonoGDB, tivars.types.list.TIList, tivars.types.picture.PictureEntry, tivars.types.real.RealEntry, tivars.types.tokenized.TIProgramCoerces this component to a subclass if possible using the component's type ID
Valid types must be registered to be considered for coercion.
tivars.flash.TIFlashHeader, tivars.types.list.TIList, tivars.types.matrix.TIMatrix, tivars.var.SizedEntryThe component's user data
tivars.flash.TIFlashHeader, tivars.var.TIEntrytivars.var.TIEntryLoads this component from a JSON dictionary representation
| Parameters | |
dct:dict | The dict to load |
| **kwargs | Undocumented |
Loads this component from a JSON dictionary representation
| Parameters | |
dct:dict | The dict to load |
| **kwargs | Undocumented |
tivars.types.complex.ComplexEntry, tivars.types.gdb.TIMonoGDB, tivars.types.list.TIList, tivars.types.matrix.TIMatrix, tivars.types.real.TIReal, tivars.types.real.TIRealRadical, tivars.types.settings.SettingsEntry, tivars.types.tokenized.TokenizedEntryLoads this component from a string representation
If there is no dedicated handler for a component type, all subclasses of the type will be considered.
| Parameters | |
string:str | The string to load |
| **kwargs | Undocumented |
tivars.types.tokenized.TokenizedEntry| Returns | |
str | A string representation of this component |
tivars.flash.TIFlashHeader, tivars.var.TIEntry| Returns | |
str | A text summary of this component |
Updates this component's metadata
All attributes self.<name> are set to self.get_<name>() if possible.
tivars.types.appvar.TIAppVar, tivars.types.complex.TIComplex, tivars.types.complex.TIComplexRadical, tivars.types.flash.TIApp, tivars.types.flash.TICertificate, tivars.types.flash.TILicense, tivars.types.flash.TIOperatingSystem, tivars.types.gdb.TIMonoGDB, tivars.types.group.TIGroup, tivars.types.list.TIComplexList, tivars.types.list.TIRealList, tivars.types.matrix.TIMatrix, tivars.types.picture.TIImage, tivars.types.picture.TIMonoPicture, tivars.types.picture.TIPicture, tivars.types.real.TIReal, tivars.types.real.TIRealRadical, tivars.types.settings.TIRecallWindow, tivars.types.settings.TITableSettings, tivars.types.settings.TIWindowSettings, tivars.types.tokenized.TIEquation, tivars.types.tokenized.TIProgram, tivars.types.tokenized.TIStringUndocumented