diff --git a/manga_translator/utils/generic.py b/manga_translator/utils/generic.py index 785eb135d..ff5da9189 100644 --- a/manga_translator/utils/generic.py +++ b/manga_translator/utils/generic.py @@ -26,13 +26,18 @@ # Adapted from argparse.Namespace class Context(dict): - __getattr__ = dict.get - __setattr__ = dict.__setitem__ - __delattr__ = dict.__delitem__ - def __init__(self, **kwargs): for name in kwargs: setattr(self, name, kwargs[name]) + + def __getattr__(self, item): + return self.get(item) + + def __delattr__(self, key) -> None: + return self.__delitem__(key) + + def __setattr__(self, key, value): + return self.__setitem__(key, value) def __eq__(self, other): if not isinstance(other, Context):