Cleanup Python scripts

This commit is contained in:
Vsevolod Kremianskii 2021-04-22 14:46:44 +07:00
parent a9840701c8
commit a25a47c8a4
4 changed files with 6 additions and 5 deletions

View file

@ -23,6 +23,10 @@ from functools import partial
extract_dir = r"D:\OpenKotOR\Extract\KotOR"
if not os.path.exists(extract_dir):
raise RuntimeError("Extraction directory does not exist")
def get_unique_json_values(extract_dir, path_pattern, extract_values):
def count_value(value, values):

View file

@ -42,7 +42,6 @@ steps = [
["convert_to_ascii_pth", "Convert binary PTH to ASCII PTH (y/n)?", None],
["disassemble_scripts", "Disassemble NCS scripts (y/n)?", None] ]
if not os.path.exists(game_dir):
raise RuntimeError("Game directory does not exist")

View file

@ -23,7 +23,6 @@ import sys
extract_dir = r"D:\OpenKotOR\Extract\KotOR"
if not os.path.exists(extract_dir):
raise RuntimeError("Extraction directory does not exist")
@ -139,4 +138,4 @@ if len(sys.argv) > 1:
voresref = sys.argv[2] if len(sys.argv) > 2 else None
generate_filelist(speaker, voresref)
else:
print('Usage: python ttsfilelist.py speaker [voresref]')
print("Usage: python filelist.py SPEAKER [VORESREF]")

View file

@ -24,7 +24,6 @@ import sys
wav_dir = r"D:\OpenKotOR\Extract\TSL\voices"
tools_dir = r"D:\Source\reone\build\bin\RelWithDebInfo"
if not os.path.exists(wav_dir):
raise RuntimeError("WAV directory does not exist")
@ -72,4 +71,4 @@ if len(sys.argv) > 1:
filelist = sys.argv[1]
unwrap_from_filelist(filelist)
else:
print('Usage: python ttsfilelist.py filelist')
print("Usage: python unwrap.py FILELIST_PATH")