salts633 / PhotoFrame

A python/browser based digital photo frame
GNU General Public License v3.0
0 stars 1 forks source link

More robust pickling #2

Closed salts633 closed 4 years ago

salts633 commented 4 years ago

Currently the use of pickles not very robust

settings.pickle

Needs to be in an appropriate try statement so that if loading from disk fails we safely fall back to the defaults

token.pickle

Again needs to be in a try statement for loading from disk, but also needs to be synced to disk when written. The final application will see this in an embedded device that needs to be able to survive power cuts and although we can ask them for settings again if something goes wrong, we don't want to be continually asking for credentials.

salts633 commented 4 years ago

Implemented in 4a57c7969e490e2f13cc00dcc20d8ced5625c558. Deliberately not syncing settings.pickle as that might be updated frequently during user interaction.