Have subtitle generation script fail loudly when it fails

This commit is contained in:
James Lambert 2023-11-23 20:31:26 -07:00
parent 189133c1fe
commit 7ea13d6c2b

View file

@ -292,8 +292,7 @@ def make_overall_subtitles_sourcefile(language_list):
def read_translation_file(filepath, encoding='utf-16-le'):
if not exists(filepath):
print(f"not found {filepath}")
return [], [], ''
raise Exception(f"not found {filepath}")
lines = []
@ -333,7 +332,6 @@ def process_all_closecaption_files(dir, language_names):
for language_name in language_names:
filename = f"closecaption_{language_name}.txt"
try:
filepath = os.path.join(dir, filename)
k,v,l = read_translation_file(filepath)
@ -379,11 +377,6 @@ def process_all_closecaption_files(dir, language_names):
'name': l,
})
print(filename, " - PASSED")
except Exception as e:
print(e)
print(filename, " - FAILED")
raise
continue
good_characters = get_supported_characters()
used_characters = set()