Move RunConfig class to own file
MODIFY
plextraktsync/_config.py
plextraktsync/_config.py
-from dataclasses import dataclass
from os import getenv
from os.path import exists
default_config_file, env_file)
-@dataclass
-class RunConfig:
- """
- Class to hold runtime config parameters
- """
-
- dry_run: bool = False
- batch_delay: int = 5
- progressbar: bool = True
-
- def update(self, **kwargs):
- for name, value in kwargs.items():
- self.__setattr__(name, value)
-
- return self
-
-
class ConfigLoader:
@classmethod
def load(cls, path: str):

ADD
plextraktsync/config/RunConfig.py
+from dataclasses import dataclass
+
+
+@dataclass
+class RunConfig:
+ """
+ Class to hold runtime config parameters
+ """
+
+ dry_run: bool = False
+ batch_delay: int = 5
+ progressbar: bool = True
+
+ def update(self, **kwargs):
+ for name, value in kwargs.items():
+ self.__setattr__(name, value)
+
+ return self

MODIFY
plextraktsync/factory.py
plextraktsync/factory.py
@@ -80,7 +80,7 @@ def progressbar(self, enabled=True):
@memoize
def run_config(self):
- from plextraktsync.config import RunConfig
+ from plextraktsync.config.RunConfig import RunConfig
config = RunConfig()

Move RunConfig class to own file