From 0151f05e831347ae752768e7c4989d26e4599cd7 Mon Sep 17 00:00:00 2001 From: snake-biscuits <36507175+snake-biscuits@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:10:14 +1000 Subject: [PATCH] (archives)(#197) `base.Archive` can optionally track filename & folder --- bsp_tool/archives/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bsp_tool/archives/base.py b/bsp_tool/archives/base.py index 870975d..d5c3961 100644 --- a/bsp_tool/archives/base.py +++ b/bsp_tool/archives/base.py @@ -18,9 +18,12 @@ def path_tuple(path: str) -> Tuple[str]: class Archive: ext = None extras: Dict[str, external.File] + folder: str + filename: str - def __init__(self): + def __init__(self, filepath: str = "untitled.ext"): self.extras = dict() + self.folder, self.filename = os.path.split(filepath) def extra_patterns(self) -> List[str]: """filename patterns for files to mount (e.g. '*.bin')"""