digitalsputnik / ApolloFirmware

Micropython software for the Apollo lamps
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

"PySaver" - Saving Variables in python #20

Closed MJoosep closed 2 years ago

MJoosep commented 2 years ago

Implement Save/Load functionality similar in usage to Python Pickle. Saving variables should be done by listing them in a Tuple and writing the Tuple to a file. Loading objects should be done using Tuple offsets to determine the correct position of a variable's value. This logic is hard coded into the load function. Saving should be done in under 3ms, for that the savable data should be kept ready in a string format. Saving/Loading should be possible to use from within objects themselves.

Example of using saving from within the object itself: "Output.Save(_rgbt)"

Use cases: