Open prandleman opened 2 years ago
OK, then the list of files to unpack will be resolved at a higher level (main). Is the following signature acceptable for your application?
Path = Union[AnyStr, os.PathLike]
def unpack(filename: Path, dest_dir: Path, file_list: Optional[Sequence[Path]] = None) -> Sequence[str]:
...
I'll need some time to look into this, I don't really know anything about type hints.
One thing I just encountered though.. First time experimenting with this I diff("2.13.0.53_aces.vromfs.bin_metadata.json", "2.13.0.60_aces.vromfs.bin_metadata.json") then used vromfs_unpacker to pull out the files I needed. This worked fine because 'nm' namemap file was listed as one of the files that changed. So when proceeding to blk_unpack it worked fine.
On the other hand, when I just went to pass in a list of fm/performance files and it failed on blk_unpack because there was no namemap file that had been unpacked when the vromfs_unpacker action took place.
All I had to do was add 'nm' to the list before unpacking. Would it be wise to always append 'nm' to index(0) of the list that will be passed or am I missing something?
In this case, the availability of the name table will depend on the way the block is packaged. If only autonomous methods of packing blocks (BBF, BBZ, FAT, FAT_ZSTD) are required, a table of names is not required for unpacking them. In War Thunder, mainly non-autonomous packaging methods are used.
The end user may not know in advance about the packaging method. Then let the nm
be added to the list automatically.
I get that these are designed for CLI/shell use build exe's, but I'm wondering if I could just pass it a python list? I kinda got the impression this was intended to be included, but when passing a list I got error
TypeError: expected str, bytes or os.PathLike object, not list
this works, but would one do it like this or create another optional argument? let me know your thoughts. I can submit a pull request (I need some practice) if you approve.