diff --git a/apio/managers/unpacker.py b/apio/managers/unpacker.py index 7c38a38d..91c8a1c9 100644 --- a/apio/managers/unpacker.py +++ b/apio/managers/unpacker.py @@ -15,18 +15,10 @@ from tarfile import open as tarfile_open from time import mktime from zipfile import ZipFile - import click - from apio import util -class UnsupportedArchiveType(util.ApioException): - """DOC: TODO""" - - MESSAGE = "Can not unpack file '{0}'" - - class ArchiveBase: """DOC: TODO""" @@ -137,7 +129,8 @@ def __init__(self, archpath: Path, dest_dir=Path(".")): # -- Archive type not known!! Raise an exception! if not self._unpacker: - raise UnsupportedArchiveType(archpath) + click.secho(f"Can not unpack file '{archpath}'") + raise util.ApioException() def start(self) -> bool: """Start unpacking the file""" diff --git a/apio/util.py b/apio/util.py index 7b9bf203..24126cc3 100644 --- a/apio/util.py +++ b/apio/util.py @@ -60,18 +60,10 @@ class ApioException(Exception): - """DOC: TODO""" - - MESSAGE = None - - def __str__(self): # pragma: no cover - if self.MESSAGE: - return self.MESSAGE.format(*self.args) - - return Exception.__str__(self) + """Apio error""" -class AsyncPipe(Thread): # pragma: no cover +class AsyncPipe(Thread): """DOC: TODO""" def __init__(self, outcallback=None):