Closed JaceyMarvin99 closed 2 years ago
In these files, it uses super-class method get()
:
https://github.com/kraanzu/termtyper/blob/c9220277db6f075812ed34929f2569cbf1343def/termtyper/ui/widgets/number_scroll.py#L31
https://github.com/kraanzu/termtyper/blob/c9220277db6f075812ed34929f2569cbf1343def/termtyper/ui/tui.py#L170
https://github.com/kraanzu/termtyper/blob/c9220277db6f075812ed34929f2569cbf1343def/termtyper/ui/widgets/option.py#L43
If we wrap the method again in the subclass Parser
, we can use a decorator to validate it before each call to prevent accidental file corruption.
The
Parser
class now has some mess, so I verify that there are no missing configuration items when the script first calls theParser.get
method, and write the default values fromparser.py
if there are any missing.