eagleflo / mpyq

Python library for reading MPQ archives.
BSD 2-Clause "Simplified" License
99 stars 23 forks source link

Supporting Directory Trees in MPQ Cross-Platform #36

Open mharradon opened 3 years ago

mharradon commented 3 years ago

PR for #36.

This PR converts backslash separated filenames in MPQs into directory trees rather than concatenated long filenames (I believe as intended by the MPQ format). In doing so it makes the library and its extraction results compatible with Windows.

There is a small interface change to share the file writing code across extracting "all files" and "some files". This does not affect command line usage.

Added minigame and test for extraction to disk for CollectMineralShards from PySC2. License from PySC2 included.

Tests confirmed passing on:

Mac: Python2.7 and 3.7 Windows: Python3.7