Browse Source

Fix Python paks being written into "dat"

pull/128/head
Adam Johnson 6 years ago
parent
commit
4b5f061ac6
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 13
      korman/exporter/outfile.py

13
korman/exporter/outfile.py

@ -207,14 +207,23 @@ class OutputFiles:
@contextmanager
def generate_dat_file(self, filename, **kwargs):
if self._is_zip:
dat_only = self._exporter().dat_only
dirname = kwargs.get("dirname", "dat")
bogus = dat_only and dirname != "dat"
if self._is_zip or bogus:
stream = hsRAMStream(self._version)
else:
if dat_only:
file_path = str(self._export_file.parent / filename)
else:
file_path = str(self._export_path / dirname / filename)
stream = hsFileStream(self._version)
stream.open(file_path, fmCreate)
backing_stream = stream
# No sense in wasting time encrypting data that isn't going to be used in the export
if not bogus:
enc = kwargs.get("enc", None)
if enc is not None:
stream = plEncryptedStream(self._version)
@ -236,7 +245,7 @@ class OutputFiles:
# Not passing enc as a keyword argument to the output file definition. It makes more
# sense to yield an encrypted stream from this context manager and encrypt as we go
# instead of doing lots of buffer copying to encrypt as a post step.
dirname = kwargs.get("dirname", "dat")
if not bogus:
kwargs = {
"file_type": _FileType.generated_dat if dirname == "dat" else
_FileType.generated_ancillary,

Loading…
Cancel
Save