general: use less explicit kompress boilerplate in modules

now get_files/kompress library can handle it transparently
This commit is contained in:
karlicoss 2023-10-14 23:18:01 +01:00
parent c63e80ce94
commit 8c2d1c9463
9 changed files with 14 additions and 19 deletions

View file

@ -257,4 +257,8 @@ class ZipPath(zipfile_Path):
)
return os.stat_result(tuple(params.values()))
@property
def suffix(self) -> str:
return Path(self.parts[-1]).suffix
# fmt: on

View file

@ -123,7 +123,8 @@ def match_structure(
searchdir = Path(tempfile.mkdtemp(dir=tdir))
zf = zipfile.ZipFile(base)
# base might already be a ZipPath, and str(base) would end with /
zf = zipfile.ZipFile(str(base).rstrip('/'))
zf.extractall(path=str(searchdir))
else: