Skip to content

Commit

Permalink
Merge pull request #800 from frederik-uni/patch-1
Browse files Browse the repository at this point in the history
remove lambda from Context
  • Loading branch information
zyddnys authored Dec 23, 2024
2 parents 89443fc + 027c966 commit 8fb93f8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions manga_translator/utils/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8fb93f8

Please sign in to comment.