コード例 #1
0
ファイル: main.py プロジェクト: Shgck/DarkSoulsDev
def import_files(archive_tree, output_dir, index = None):
    """ Import the data located in archive_tree in an external archive that will
    be written in output_dir. An archive index can be provided. """
    if index is None:
        bhd_name = "dvdbnd.bhd5"
    else:
        bhd_name = "dvdbnd{}.bhd5".format(index)
    archive_bhd_path = os.path.join(output_dir, bhd_name)
    archive = ExternalArchive()
    archive.import_files(archive_tree, archive_bhd_path)
コード例 #2
0
ファイル: main.py プロジェクト: Shgck/DarkSoulsDev
def export_archive(bhd_path, output_dir, filelist_path):
    """ Export the archive located at bhd_path in the directory output_dir.
    A filelist can be provided as filelist_path. """
    archive = ExternalArchive()
    load_success = archive.load(bhd_path)
    if not load_success:
        return
    if filelist_path:
        archive.load_filelist(filelist_path)
    archive.export_all_files(output_dir)