auto expand user
This commit is contained in:
@@ -20,6 +20,10 @@ class Komga:
|
|||||||
def _setattr(self, name, value):
|
def _setattr(self, name, value):
|
||||||
setattr(self, name, value)
|
setattr(self, name, value)
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
if "~" in self.media_path:
|
||||||
|
self.media_path = os.path.expanduser(self.media_path)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class General:
|
class General:
|
||||||
@@ -57,7 +61,15 @@ class KomGrabber:
|
|||||||
"""KomGrabber settings."""
|
"""KomGrabber settings."""
|
||||||
|
|
||||||
download_location: str
|
download_location: str
|
||||||
|
get_chapters: bool
|
||||||
|
skip_parameters: List[str]
|
||||||
aria2: Aria2
|
aria2: Aria2
|
||||||
|
tag_interactive: bool
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
self.skip_parameters = [param.lower() for param in self.skip_parameters]
|
||||||
|
if "~" in self.download_location:
|
||||||
|
self.download_location = os.path.expanduser(self.download_location)
|
||||||
|
|
||||||
def getattr(self, name):
|
def getattr(self, name):
|
||||||
return getattr(self, name)
|
return getattr(self, name)
|
||||||
@@ -80,6 +92,12 @@ class KomTagger:
|
|||||||
def _setattr(self, name, value):
|
def _setattr(self, name, value):
|
||||||
setattr(self, name, value)
|
setattr(self, name, value)
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
if "~" in self.failed_location:
|
||||||
|
self.failed_location = os.path.expanduser(self.failed_location)
|
||||||
|
if "~" in self.success_location:
|
||||||
|
self.success_location = os.path.expanduser(self.success_location)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class ComicVine:
|
class ComicVine:
|
||||||
@@ -122,6 +140,10 @@ class ComicsOrg:
|
|||||||
def _setattr(self, name, value):
|
def _setattr(self, name, value):
|
||||||
setattr(self, name, value)
|
setattr(self, name, value)
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
if "~" in self.path:
|
||||||
|
self.path = os.path.expanduser(self.path)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class API:
|
class API:
|
||||||
|
|||||||
Reference in New Issue
Block a user