コード例 #1
0
ファイル: dcx_tool.py プロジェクト: Shgck/DarkSoulsDev
def compress(file_path):
    print("Compress", file_path)
    dcx = Dcx()
    load_success = dcx.load_decompressed(file_path)
    if not load_success:
        return
    dcx_path = file_path + ".dcx"
    dcx.save(dcx_path)
コード例 #2
0
    def _compress(file_path, remove_original = True):
        """ Compress the file in a DCX file and can remove the original. """
        dcx = Dcx()
        import_success = dcx.load_decompressed(file_path)
        if not import_success:
            return False

        dcx_path = file_path + ".dcx"
        export_success = dcx.save(dcx_path)

        if remove_original:
            os.remove(file_path)
        return export_success