NSoiffer / MathCATForPython

A Python Interface and NVDA plugin to MathCAT
MIT License
6 stars 6 forks source link

Validate settings read from disk #21

Closed ways2read closed 2 years ago

ways2read commented 2 years ago

Add function to check that preference settings are present and valid, use defaults if not.

Resolves #17

ways2read commented 2 years ago

Agreed, this is clunky and repetitive. I'm not sure I can use exactly the approach you suggest since I think it may throw an exception before I am ready to catch it. But I have enough of a pointer to go on (pun intended!).

NSoiffer commented 2 years ago

I think by moving it into a function, you can do the catch there and do the correction there (which is why I suggested added the default value to the call).