Skip to content

Commit

Permalink
Add warnings in docs about entries vs. vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Apr 26, 2024
1 parent ca2b3c2 commit 9d1c572
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tivars/flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def open(cls, filename: str) -> 'TIFlashHeader':

def save(self, filename: str = None, model: TIModel = TI_84PCE):
"""
Saves this header given a filename and targeted model
Saves this header to the current directory given a filename and targeted model
:param filename: A filename to save to (defaults to the header's name and extension)
:param model: A model to target (defaults to ``TI_84PCE``)
Expand Down
10 changes: 9 additions & 1 deletion tivars/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ class TIEntry(Dock, Converter):
Base class for all var entries
A var file is made of one or more entries, each of which contain the data of the familiar var types.
**Even though most var files have just one entry, an entry does NOT constitute a complete var file.**
**All var files require an attached header and other metadata.**
**Use `TIEntry.export` to create a new `TIVar` containing the entry, with an optional custom header.**
**Use `TIEntry.save` to export and save the entry in a var file in the current directory.**
"""

_T = 'TIEntry'
Expand Down Expand Up @@ -729,6 +735,8 @@ def load_bytes(self, data: bytes | BytesIO):

def bytes(self) -> bytes:
"""
**Note: These bytes do NOT constitute a complete var file. Use `.export` or `.save` when saving a var file.**
:return: The bytes contained in this entry
"""

Expand Down Expand Up @@ -829,7 +837,7 @@ def open(cls, filename: str) -> 'TIEntry':

def save(self, filename: str = None, *, header: TIHeader = None, model: TIModel = None):
"""
Saves this entry as a var file given a filename and optional header and targeted model
Saves this entry as a var file in the current directory given a filename and optional header and targeted model
:param filename: A filename to save to (defaults to the var's name and extension)
:param header: A `TIHeader` to attach (defaults to an empty header)
Expand Down

0 comments on commit 9d1c572

Please sign in to comment.