diff options
author | antoniou79 | 2019-01-02 19:46:21 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2019-01-06 17:12:02 +0100 |
commit | 729d8a20ff09fb68b0c9c85994083858b33561ca (patch) | |
tree | e320c3a1e2c8c233de239c5da9716c5f1ede7d27 /devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator | |
parent | fa64a064a1c583d75e1f64dabbe4cda83aa02c5b (diff) | |
download | scummvm-rg350-729d8a20ff09fb68b0c9c85994083858b33561ca.tar.gz scummvm-rg350-729d8a20ff09fb68b0c9c85994083858b33561ca.tar.bz2 scummvm-rg350-729d8a20ff09fb68b0c9c85994083858b33561ca.zip |
DEVTOOLS: BladeRunner MIX multilanguage support
mixResourceCreator now additionally supports ITA, FRA, ESP, GER
Diffstat (limited to 'devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator')
-rw-r--r-- | devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py index 60094b94d8..ec47a038df 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py @@ -106,6 +106,7 @@ def initActorPropertyEntries(thePathToActorNamesTxt): global gActorPropertyEntriesWasInit global gActorPropertyEntries firstLine = True + gActorPropertyEntriesWasInit = False # print "[Debug] opening actornames" if thePathToActorNamesTxt is None or not thePathToActorNamesTxt: @@ -113,20 +114,29 @@ def initActorPropertyEntries(thePathToActorNamesTxt): relPath = u'.' thePathToActorNamesTxt = os.path.join(relPath, actorNamesTextFile) print "[Warning] Actor names text file %s not found in arguments. Attempting to open local file if it exists" % (thePathToActorNamesTxt) - with open(thePathToActorNamesTxt) as tsv: - for line in csv.reader(tsv, dialect="excel-tab"): - #skip first line header - if firstLine == True: -# print "[Debug] Skipping Header line in Excel sheet" - firstLine = False - else: - gActorPropertyEntries.append(line) - gActorPropertyEntriesWasInit = True - tsv.close() + + if os.access(thePathToActorNamesTxt, os.F_OK): + print "[Info] Actor names text file found: {0}.".format(thePathToActorNamesTxt) + + with open(thePathToActorNamesTxt) as tsv: + if gTraceModeEnabled: + print "[Debug] Parsing Override Encoding file info..." + for line in csv.reader(tsv, dialect="excel-tab"): + #skip first line header + if firstLine == True: + #if gTraceModeEnabled: + # print "[Debug] Skipping Header line in Excel sheet" + firstLine = False + else: + gActorPropertyEntries.append(line) + gActorPropertyEntriesWasInit = True + tsv.close() + else: + ## error + print "[Error] Actor names text file not found: {0}.".format(thePathToActorNamesTxt) + sys.exit(1) # terminate if finding actor names file failed (Blade Runner) def getActorShortNameById(lookupActorId): - global gActorPropertyEntriesWasInit - global gActorPropertyEntries if not gActorPropertyEntriesWasInit: return '' else: @@ -137,8 +147,6 @@ def getActorShortNameById(lookupActorId): def getActorFullNameById(lookupActorId): - global gActorPropertyEntriesWasInit - global gActorPropertyEntries if not gActorPropertyEntriesWasInit: return '' else: @@ -148,8 +156,6 @@ def getActorFullNameById(lookupActorId): return '' def getActorIdByShortName(lookupActorShortName): - global gActorPropertyEntriesWasInit - global gActorPropertyEntries if not gActorPropertyEntriesWasInit: return '' else: |