feature: add __getitem__ to config.

This commit is contained in:
Upstream Data
2024-05-10 13:08:45 -06:00
parent 52adc2553b
commit 7f191eb2fd
2 changed files with 19 additions and 0 deletions

View File

@@ -67,6 +67,13 @@ class MinerConfigOption(Enum):
def default(cls):
pass
def __getitem__(self, item):
try:
return getattr(self, item)
except AttributeError:
raise KeyError
@dataclass
class MinerConfigValue:
@@ -112,3 +119,9 @@ class MinerConfigValue:
def as_mara(self) -> dict:
return {}
def __getitem__(self, item):
try:
return getattr(self, item)
except AttributeError:
raise KeyError