Skip to content

Commit

Permalink
Move TemplateSettings class from base to settings_manager. It is not …
Browse files Browse the repository at this point in the history
…used in base, and creates an unnecessary import
  • Loading branch information
LobaDK committed Aug 19, 2024
1 parent bdf024d commit 433e160
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 0 additions & 9 deletions settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@
T = TypeVar("T")


class TemplateSettings:
"""
Used by SettingsManagerClass to convert a dictionary to an object using json.loads and json.dumps.
"""

def __init__(self, dict: dict) -> None:
self.__dict__.update(dict)


class SettingsManagerBase(ABC, Generic[T]):
def __init__(
self,
Expand Down
11 changes: 10 additions & 1 deletion settings/settings_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from json import dumps, loads
from settings.base import SettingsManagerBase, TemplateSettings
from settings.base import SettingsManagerBase


from dacite import from_dict
Expand All @@ -12,6 +12,15 @@
T = TypeVar("T")


class TemplateSettings:
"""
Used by SettingsManagerClass to convert a dictionary to an object using json.loads and json.dumps.
"""

def __init__(self, dict: dict) -> None:
self.__dict__.update(dict)


class SettingsManagerWithDataclass(SettingsManagerBase[T]):
def _to_dict(self, obj: object) -> Dict[str, Any]:
"""
Expand Down

0 comments on commit 433e160

Please sign in to comment.