mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-13 18:14:24 +02:00
swap AttrDict for benedict everywhere
This commit is contained in:
@@ -2,17 +2,19 @@ from pathlib import Path
|
|||||||
from typing import Optional, Dict, Union, Tuple, Callable, Pattern, Type, Any, List
|
from typing import Optional, Dict, Union, Tuple, Callable, Pattern, Type, Any, List
|
||||||
from mypy_extensions import TypedDict
|
from mypy_extensions import TypedDict
|
||||||
|
|
||||||
|
from benedict import benedict
|
||||||
|
|
||||||
SimpleConfigValue = Union[str, bool, int, None, Pattern, Dict[str, Any]]
|
SimpleConfigValue = Union[str, bool, int, None, Pattern, Dict[str, Any]]
|
||||||
SimpleConfigValueDict = Dict[str, SimpleConfigValue]
|
SimpleConfigValueDict = Dict[str, SimpleConfigValue]
|
||||||
SimpleConfigValueGetter = Callable[[], SimpleConfigValue]
|
SimpleConfigValueGetter = Callable[[], SimpleConfigValue]
|
||||||
ConfigValue = Union[SimpleConfigValue, SimpleConfigValueDict, SimpleConfigValueGetter]
|
ConfigValue = Union[SimpleConfigValue, SimpleConfigValueDict, SimpleConfigValueGetter]
|
||||||
|
|
||||||
class AttrDict(dict):
|
# class AttrDict(dict):
|
||||||
def __init__(self, *args, **kwargs):
|
# def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
# super().__init__(*args, **kwargs)
|
||||||
self.__dict__ = self
|
# self.__dict__ = self
|
||||||
|
AttrDict = benedict # https://github.com/fabiocaccamo/python-benedict/
|
||||||
|
|
||||||
|
|
||||||
class BaseConfig(TypedDict):
|
class BaseConfig(TypedDict):
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user