Example #1
0
def decompress(dcx_path):
    print("Decompress", dcx_path)
    dcx = Dcx()
    load_success = dcx.load(dcx_path)
    if not load_success:
        return
    basefile_path = os.path.splitext(dcx_path)[0]
    dcx.save_decompressed(basefile_path)
Example #2
0
    def _decompress(file_path, remove_dcx = True):
        """ Decompress that file and remove the compressed original (DCX) if
        remove_dcx is True. Return True on success. """
        dcx = Dcx()
        import_success = dcx.load(file_path)
        if not import_success:
            return False

        decompressed_path = os.path.splitext(file_path)[0]  # remove the .dcx
        export_success = dcx.save_decompressed(decompressed_path)
        if not export_success:
            return False

        if remove_dcx:
            os.remove(file_path)
        return True