Skip to content

Commit

Permalink
feat: add output_dir property to directory pack writers
Browse files Browse the repository at this point in the history
  • Loading branch information
kmontag committed Jul 27, 2024
1 parent 2e3a879 commit afac7e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/alpax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ def __init__(self, output_dir: str | os.PathLike, **k: Unpack[PackProperties]):
# Keys are paths within the pack.
self._tags: dict[str, Collection[Tag]] = {}

@property
def output_dir(self) -> str | os.PathLike:
return self._output_dir

@override
async def set_file(self, path: str, file: str) -> None:
await self._copy_to_path(path, file)
Expand Down Expand Up @@ -355,3 +359,7 @@ class DirectoryPackWriter(PackWriter[DirectoryPackWriterAsync]):
def __init__(self, output_dir: str | os.PathLike, **k: Unpack[PackProperties]):
pack_writer_async = DirectoryPackWriterAsync(output_dir, **k)
super().__init__(pack_writer_async)

@property
def output_dir(self) -> str | os.PathLike:
return self._pack_writer_async.output_dir

0 comments on commit afac7e0

Please sign in to comment.