aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator
diff options
context:
space:
mode:
authorantoniou792019-01-03 03:25:08 +0200
committerEugene Sandulenko2019-01-06 17:12:02 +0100
commitd8a16280583a1acb6c077744181d37f9d190f407 (patch)
tree54e2f580e106cdb7ccd60326e0f8370510230462 /devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator
parent63e742212724f160740d835102cbd0b0328092c5 (diff)
downloadscummvm-rg350-d8a16280583a1acb6c077744181d37f9d190f407.tar.gz
scummvm-rg350-d8a16280583a1acb6c077744181d37f9d190f407.tar.bz2
scummvm-rg350-d8a16280583a1acb6c077744181d37f9d190f407.zip
DEVTOOLS: Placeholder VQA sheets, POGO, DEV COMMENTARY
Diffstat (limited to 'devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator')
-rw-r--r--devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py65
-rw-r--r--devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py199
-rw-r--r--devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py157
3 files changed, 415 insertions, 6 deletions
diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py
new file mode 100644
index 0000000000..cb9f064fc1
--- /dev/null
+++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/devCommentaryText.py
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+#
+
+my_module_version = "1.00"
+my_module_name = "devCommentaryText"
+
+# All game versions should have the English text pre-filled in the POGO sheet
+DEV_AUDIO_COMMENTART_TUPLE_LIST = [
+ ("MA04VO1A.AUD", "Yes, this is McCoy's apartment. Probably one of the more pivotal areas in the game. You'll notice that if you walk McCoy into the bathroom on the right hand side over there a really weird thing happens. One of the things the player might not pick up on but is rather important is McCoy doesn't wash his hands every time he uses the bathroom. This can possibly lead the player to believe that: a) Ray McCoy is a Replicant who doesn't care about germs and, you know, doesn't use to wash his hands or b) McCoy is just kind of a slob."),
+ ("CT01VO1A.AUD", "Oh, yeah, this is the Chinatown scene with Howie's restaurant. You'll notice that Howie is moving his arms in the air. The thing we were trying to pull off here was that he was making the sushi but we had a lot of problems with the sushi going bad under the lights and it just wasn't a good scene, so what you're seeing in the final version here is we had to get rid of the lot of the fish and sushi and we're a little disappointed in this area."),
+ ("HC01VO1A.AUD", "This is an area known as Hawker's Circle. It's sort of a swamp pit, so to speak where a lot of the scum of the earth hang out. Notice again the constant Asian reminder here showing you that Asians are often living in poor rather dingy areas of the city.")
+]
+
+DEV_ISEZ_QUOTES_TUPLE_LIST = [
+ ("I_SEZ", "Blade Runner\nFrom the dark recesses of David Leary's imagination comes a game unlike any\nother. Blade Runner immerses you in the underbelly of future Los Angeles. Right\nfrom the start, the story pulls you in with graphic descriptions of a\ngrandmother doing the shimmy in her underwear, child molestation, brutal\ncold-blooded slaying of innocent animals, vomiting on desks, staring at a\nwoman's ass, the list goes on. And when the game starts, the real fun begins -\nshoot down-on-their-luck homeless people and toss them into a dumpster. Watch\nwith sadistic glee as a dog gets blown into chunky, bloody, bits by an\nexplosive, and even murder a shy little girl who loves you. If you think David\nLeary is sick, and you like sick, this is THE game for you.\n\nJW: Don't forget the wasting of helpless mutated cripples in the underground.\nIt's such a beautiful thing!\n\nDL: Go ahead. Just keep beating that snarling pit bull...ignore the foam\naround his jaws. There's room on the top shelf of my fridge for at least one\nmore head... - Psychotic Dave\n"),
+ ("I_SEZ", "MG: Is David Leary a self-respecting human or is he powered by rechargeable\nBatteries?"),
+ ("I_SEZ", "JM: That McCoy--he's one funny guy! Jet-black fire truck, hehehehe..."),
+ ("I_SEZ", "JM: Did it have a huge, ugly piece of chrome on it?"),
+ ("I_SEZ", "JM: This officer has a talent for vivid metaphors."),
+ ("I_SEZ", "DL: What is that supposed to mean? I didn't write this line..."),
+ ("I_SEZ", "MG: Hey, leave that officer alone. Can't you see he's busy?\nJM: (...mmm, donuts...)"),
+ ("I_SEZ", "MG: It's all fun and games until someone loses a tiger cub."),
+ ("I_SEZ", "JM: Chrome...is that what that is?"),
+ ("I_SEZ", "JM: It's hard to imagine that thing on either a car or a horse.\nMG: McCoy! What a witty chap...\nJM: He keeps me chuckling non-stop!"),
+ ("I_SEZ", "MG: Leaving already? The fun is just beginning!"),
+ ("I_SEZ", "MG: We don't want any of that abstract art oozing out onto the street.")
+]
+#
+#
+#
+class devCommentaryText:
+ m_traceModeEnabled = True
+ # traceModeEnabled is bool to enable more printed debug messages
+ def __init__(self, traceModeEnabled = True):
+ self.m_traceModeEnabled = traceModeEnabled
+ return
+
+ def printTexts(self):
+ print "AUDIO COMMENTARY"
+ for (idTre, textTre) in DEV_AUDIO_COMMENTART_TUPLE_LIST:
+ print "%s\t%s" % (idTre, textTre)
+ print "I_SEZ QUOTES"
+ for (idTre, textTre) in DEV_ISEZ_QUOTES_TUPLE_LIST:
+ print "%s\t%s" % (idTre, textTre)
+ return
+
+ def getAudioCommentaryTextEntriesList(self):
+ return DEV_AUDIO_COMMENTART_TUPLE_LIST
+
+ def getISEZTextEntriesList(self):
+ return DEV_ISEZ_QUOTES_TUPLE_LIST
+
+if __name__ == '__main__':
+ # main()
+ print "[Debug] Running %s as main module" % (my_module_name)
+ traceModeEnabled = False
+ devCommentaryTextInstance = devCommentaryText(traceModeEnabled)
+ devCommentaryTextInstance.printTexts()
+
+else:
+ #debug
+ #print "[Debug] Running %s imported from another module" % (my_module_name)
+ pass
+ \ No newline at end of file
diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py
new file mode 100644
index 0000000000..ca7ca3c0e1
--- /dev/null
+++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/pogoTextResource.py
@@ -0,0 +1,199 @@
+#!/usr/bin/env python
+# -*- coding: UTF-8 -*-
+#
+
+my_module_version = "1.00"
+my_module_name = "pogoTextResource"
+
+# All game versions should have the English text pre-filled in the POGO sheet
+POGO_TEXT_RESOURCE_TUPLE_LIST = [
+ (0, "Air Conditioning"),
+ (1, "Amy Shoopman"),
+ (2, "Andy B. and the Milk Carton Kids"),
+ (3, "Area 51"),
+ (4, "Aspirin"),
+ (5, "Babylon 5"),
+ (6, "Bandit"),
+ (7, "Bauer Inline Skates"),
+ (8, "Bill Randolph"),
+ (9, "Bill (Mr. Motorola) and Sarah"),
+ (10, "Boo Berry and Frankenberry"),
+ (11, "Brett W. Sperry"),
+ (12, "Brianhead Ski Resort"),
+ (13, "Bubba"),
+ (14, "Bubbles"),
+ (15, "Building 2 Parking"),
+ (16, "The Buke"),
+ (17, "Chan \"The Emporer\" Lee"),
+ (18, "Cheezy Poofs"),
+ (19, "Chuck \"Walter\" Karras"),
+ (20, "Cinco De Mayo"),
+ (21, "Club Med"),
+ (22, "Code Complete"),
+ (23, "Coffee Pub, Las Vegas"),
+ (24, "Coke"),
+ (25, "Coin Magic"),
+ (26, "Count Chocula"),
+ (27, "Dad"),
+ (28, "David Arkenstone"),
+ (29, "Digital Camera"),
+ (30, "Direct X Team"),
+ (31, "Denis and Joanne Dyack"),
+ (32, "Blue Bayou, Disneyland"),
+ (33, "Dongle-Boy"),
+ (34, "Doves and Sparrows"),
+ (35, "Dovey"),
+ (36, "Draracles"),
+ (37, "Dry Air"),
+ (38, "Ed Del Castillo"),
+ (39, "Eric \"Kick Ass\" Cartman"),
+ (40, "FHM"),
+ (41, "Fog City Diner"),
+ (42, "Fog Studios"),
+ (43, "Gatorade"),
+ (44, "Gandhi Cuisine of India"),
+ (45, "Giant Lava Lamp"),
+ (46, "Eric and Nancy Gooch"),
+ (47, "Grayford Family"),
+ (48, "Comet Hale-Bopp"),
+ (49, "Joseph B. Hewitt IV"),
+ (50, "Hercules"),
+ (51, "Hillbilly Jeopardy"),
+ (52, "Home Cookin'"),
+ (53, "Hooey Stick"),
+ (54, "The Hypnotist"),
+ (55, "Insects on the Move"),
+ (56, "Intel"),
+ (57, "James Hong"),
+ (58, "Jasmine"),
+ (59, "The Mysterious Cockatiel"),
+ (60, "Joe's Frog"),
+ (61, "Jed"),
+ (62, "Jeeps"),
+ (63, "Jeeter"),
+ (64, "Jeff Brown"),
+ (65, "JoeB"),
+ (66, "Joe-Bob McClintock"),
+ (67, "Joseph Turkel"),
+ (68, "Jose Cuervo"),
+ (69, "Juggling Balls"),
+ (70, "Keith Parkinson"),
+ (71, "Khan"),
+ (72, "King of the Hill"),
+ (73, "Kurt O. and the Toothbrush Squad"),
+ (74, "Leonard and Shirley Legg"),
+ (75, "Leroy"),
+ (76, "Brion James"),
+ (77, "Louis and his \"friend\""),
+ (78, "M.C. Crammer and Janie"),
+ (79, "Men's Room Magna-Doodle"),
+ (80, "Mark and Deepti Rowland"),
+ (81, "Metro Pizza, Las Vegas"),
+ (82, "Matt Vella"),
+ (83, "Maui"),
+ (84, "1 Million Candlepower Spotlight"),
+ (85, "Mom"),
+ (86, "Movie-makers"),
+ (87, "Mr. Nonsense"),
+ (88, "Needles"),
+ (89, "Nerf Weaponry"),
+ (90, "Nimbus"),
+ (91, "Norm Vordahl"),
+ (92, "KNPR"),
+ (93, "Olive Garden"),
+ (94, "Onkyo"),
+ (95, "Orangey"),
+ (96, "Osbur, the Human Resource Manager"),
+ (97, "Our Cheery Friend Leary"),
+ (98, "Ousted Gnome King"),
+ (99, "Pepsi"),
+ (100, "Peta Wilson"),
+ (101, "Pogo the Mockingbird"),
+ (102, "Poker Nights"),
+ (103, "Pirates"),
+ (104, "Playmate Lingerie Calendar"),
+ (105, "Pop-Ice"),
+ (106, "Powerhouse Gym"),
+ (107, "Rade McDowell"),
+ (108, "Red Rock Canyon"),
+ (109, "Refrigeration"),
+ (110, "Rhoda"),
+ (111, "Richard and Kimberly Weier"),
+ (112, "Ridley Scott"),
+ (113, "Ruud the Dude"),
+ (114, "Our old pal Rick Parks"),
+ (115, "Ruby's Diner"),
+ (116, "Savatage"),
+ (117, "Scully and Mulder"),
+ (118, "Sean Young"),
+ (119, "Seinfeld"),
+ (120, "The Shadow"),
+ (121, "Shakes"),
+ (122, "Shorts"),
+ (123, "Silly Putty"),
+ (124, "The Simpsons"),
+ (125, "Thomas Christensen"),
+ (126, "We love you Steve Wetherill!!!"),
+ (127, "Skank"),
+ (128, "Slice"),
+ (129, "SSG"),
+ (130, "Steve and Anne Tall"),
+ (131, "South Park"),
+ (132, "Snap 'n Pops"),
+ (133, "Sneaker"),
+ (134, "Star Wars Trilogy"),
+ (135, "Nonstop Summer Pool Parties"),
+ (136, "Sunsets"),
+ (137, "T-Bone and Angie"),
+ (138, "T-shirts"),
+ (139, "Julio Schembari, Tango Pools"),
+ (140, "The Thermostat Key"),
+ (141, "The Wizard"),
+ (142, "Tomb Raider"),
+ (143, "Tom Elmer II"),
+ (144, "Tujia Linden"),
+ (145, "Turbo"),
+ (146, "Tweeter"),
+ (147, "Twonky"),
+ (148, "Ty and Judy Coon"),
+ (149, "The Courtyard"),
+ (150, "U.F.C."),
+ (151, "Uli Boehnke"),
+ (152, "Virgil"),
+ (153, "Virtual Boy"),
+ (154, "Westwood Offroad Excursion Team"),
+ (155, "William Sanderson"),
+ (156, "Xena"),
+ (157, "Zion National Park"),
+ (158, "We 3 coders give special thanks to:")
+ ]
+#
+#
+#
+class pogoTextResource:
+ m_traceModeEnabled = True
+ # traceModeEnabled is bool to enable more printed debug messages
+ def __init__(self, traceModeEnabled = True):
+ self.m_traceModeEnabled = traceModeEnabled
+ return
+
+ def printPogo(self):
+ for (idTre, textTre) in POGO_TEXT_RESOURCE_TUPLE_LIST:
+ print "%s\t%s" % (idTre, textTre)
+ return
+
+ def getPogoEntriesList(self):
+ return POGO_TEXT_RESOURCE_TUPLE_LIST
+
+if __name__ == '__main__':
+ # main()
+ print "[Debug] Running %s as main module" % (my_module_name)
+ traceModeEnabled = False
+ pogoTRInstance = pogoTextResource(traceModeEnabled)
+ pogoTRInstance.printPogo()
+
+else:
+ #debug
+ #print "[Debug] Running %s imported from another module" % (my_module_name)
+ pass
+ \ No newline at end of file
diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py
index ec47a038df..447da53bc8 100644
--- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py
+++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py
@@ -42,6 +42,8 @@ from os import walk, errno, path
from xlwt import *
from audFileLib import *
from treFileLib import *
+from pogoTextResource import *
+from devCommentaryText import *
# encoding=utf8
#reload(sys)
@@ -56,13 +58,41 @@ APP_SHORT_DESC = "* Create an Excel (.XLS) for transcribing Blade Runner.\n* (Op
OUTPUT_XLS_FILENAME = 'out'
OUTPUT_XLS_FILENAME_EXT = '.xls'
-OUTPUT_XLS_QUOTES_SHEET = 'INGQUO_E.TR'
+OUTPUT_XLS_QUOTES_SHEET = 'INGQUO_' # needs suffix x.TRx where x is the language code
SUPPORTED_TLK_INPUT_FILES = [('1.TLK', 'TLK01'), ('2.TLK', 'TLK02'), ('3.TLK', 'TLK03'), ('A.TLK', 'TLK0A'), ('SPCHSFX.TLK', 'TLKSPCHSFX')]
SUPPORTED_MIX_INPUT_FILES = ['STARTUP.MIX']
# 15 TRx files
SUPPORTED_EXPORTED_TRx_FILES = ['CLUES.TR','ACTORS.TR','CRIMES.TR','CLUETYPE.TR','KIA.TR','SPINDEST.TR','VK.TR','OPTIONS.TR','DLGMENU.TR','ENDCRED.TR','HELP.TR','SCORERS.TR','KIACRED.TR','ERRORMSG.TR','AUTOSAVE.TR']
-SUPPORTED_PLACEHOLDER_VQA_FILES = ['WSTLGO_', 'BRLOGO_', 'INTRO_', 'MW_A_', 'MW_B01_', 'MW_B02_', 'MW_B03_', 'MW_B04_', 'MW_B05_', 'INTRGT_', 'MW_D_', 'MW_C01_', 'MW_C02_', 'MW_C03_', 'END04A_', 'END04B_', 'END04C_', 'END06_', 'END01A_', 'END01B_', 'END01C_', 'END01D_', 'END01E_', 'END01F_', 'END03_']
+SUPPORTED_PLACEHOLDER_VQA_ENGLISH_FILES = [
+ ('WSTLGO_', 'Westwood Studios Partnership Intro'),
+ ('BRLOGO_', 'Blade Runner Logo')]
+SUPPORTED_PLACEHOLDER_VQA_LOCALIZED_FILES = [
+ ('INTRO_', 'Intro cutscene - Prologue'),
+ ('MW_A_', 'Eisenduller murder scene'),
+ ('MW_B01_', 'Act 3 intro part - Start part'),
+ ('MW_B02_', 'Act 3 intro part - Lucy is Replicant'),
+ ('MW_B03_', 'Act 3 intro part - Dektora is Replicant'),
+ ('MW_B04_', 'Act 3 intro part - Lucy and Dektora are human'),
+ ('MW_B05_', 'Act 3 intro part - End part '),
+ ('INTRGT_', 'Interrogation scene - Baker, Holloway, McCoy'),
+ ('MW_C01_', 'Clovis and Sadik pay a visit to the Twins - Start Part'),
+ ('MW_C02_', 'Clovis and Sadik pay a visit to the Twins - Clovis has an INCEPT PHOTO'),
+ ('MW_C03_', 'Clovis and Sadik pay a visit to the Twins - Clovis DOES NOT have an INCEPT PHOTO'),
+ ('MW_D_', 'Tyrell, Kolvig and Clovis meet-up at Tyrell Corp'),
+ ('END01A_', 'Underground getaway - Lucy Human'),
+ ('END01B_', 'Underground getaway - Lucy with DNA'),
+ ('END01C_', 'Underground getaway - Lucy not enough DNA'),
+ ('END01D_', 'Underground getaway - Dektora Human'),
+ ('END01E_', 'Underground getaway - Dektora with DNA'),
+ ('END01F_', 'Underground getaway - Dektora, not enough DNA'),
+ ('END03_', 'Underground getaway - McCoy alone'),
+ ('END04A_', 'Finale - McCoy on Moonbus'),
+ ('END04B_', 'Finale - McCoy with Lucy on Moonbus'),
+ ('END04C_', 'Finale - McCoy with Dektora on Moonbus'),
+ ('END06_', 'Underground getaway - Steele Ending')
+ ]
+SUPPORTED_SPECIAL_POGO_FILE = 'POGO.TR'
SUPPORTED_LANGUAGES_DESCRIPTION_CODE_TLIST = [('EN_ANY', 'E', 'English'), ('DE_DEU', 'G', 'German'), ('FR_FRA', 'F', 'French'), ('IT_ITA', 'I', 'Italian'), ('ES_ESP', 'S', 'Spanish'), ('RU_RUS', 'R', 'Russian')]
DEFAULT_LANG_DESC_CODE = SUPPORTED_LANGUAGES_DESCRIPTION_CODE_TLIST[0]
@@ -310,6 +340,89 @@ def inputTLKsExport(inputTLKpath, outputWAVpath):
# SYS EXIT IS HERE ONLY FOR DEBUG PURPOSES OF PARSING TLK FILES - SHOULD BE COMMENTED OUT NORMALLY
# sys.exit(0)
return
+
+
+def appendVQAPlaceHolderSheets(excelOutBook = None):
+ if excelOutBook != None:
+ print "[Info] Appending placeholder sheets for supported video cutscenes (VQA)..."
+ currVQAFileNameLclzd = None
+ for currVQAFileNameDesc in SUPPORTED_PLACEHOLDER_VQA_ENGLISH_FILES + SUPPORTED_PLACEHOLDER_VQA_LOCALIZED_FILES:
+ if currVQAFileNameDesc in SUPPORTED_PLACEHOLDER_VQA_ENGLISH_FILES:
+ currVQAFileNameLclzd = currVQAFileNameDesc[0] + 'E.VQA'
+ elif currVQAFileNameDesc in SUPPORTED_PLACEHOLDER_VQA_LOCALIZED_FILES:
+ currVQAFileNameLclzd = currVQAFileNameDesc[0] + ('%s' % (gActiveLanguageDescriptionCodeTuple[1])) + '.VQA'
+ if currVQAFileNameLclzd is not None:
+ if gTraceModeEnabled:
+ print "[Debug] Creating placeholder sheet %s: %s!" % (currVQAFileNameLclzd, currVQAFileNameDesc[1])
+ sh = excelOutBook.add_sheet(currVQAFileNameLclzd)
+ # First Row
+ n = 0 # keeps track of rows
+ col_names = ['VQA File: %s' % (currVQAFileNameLclzd), '22050 audio sampling rate', currVQAFileNameDesc[1] ]
+ colIdx = 0
+ for colNameIt in col_names:
+ sh.write(n, colIdx, colNameIt)
+ colIdx+=1
+
+ # Second Row
+ n = 1
+
+ col_names = ['Start (YT)', 'End (YT)', 'Subtitle', 'By Actor', 'StartTime', 'Time Diff-SF', 'TimeDiff-SF(ms)', 'TimeDiff-EF', 'TimeDiff-EF(ms)', 'Frame Start', 'Frame End', 'Notes']
+ colIdx = 0
+ for colNameIt in col_names:
+ sh.write(n, colIdx, colNameIt)
+ colIdx+=1
+ #n+=1
+
+ return
+
+def appendDevCommentarySheet(excelOutBook = None):
+ if excelOutBook != None:
+ print "[Info] Appending Developer Commentary sheet..."
+ if excelOutBook != None:
+ sh = excelOutBook.add_sheet("DEV COMMENTARY")
+ devCommentaryTextInstance = devCommentaryText(gTraceModeEnabled)
+ # First Segment
+ n = 0 # keeps track of rows
+ col_names = ['AUDIO COMMENTARY']
+ colIdx = 0
+ for colNameIt in col_names:
+ sh.write(n, colIdx, colNameIt)
+ colIdx+=1
+ n+= 1
+
+ for idStr, textStr in devCommentaryTextInstance.getAudioCommentaryTextEntriesList():
+ sh.write(n, 0, idStr)
+ objUTF8SafeStr = ""
+ for i in range(0, len(textStr)):
+ objUTF8SafeStr += textStr[i]
+ try:
+ objUTF8Unicode = unicode(objUTF8SafeStr, 'utf-8')
+ except Exception as e:
+ print '[Error] Failed to create unicode string: ' + str(e)
+ objUTF8Unicode = unicode("???", 'utf-8')
+ sh.write(n, 1, objUTF8Unicode)
+ n+=1
+ # Second Segment
+ col_names = ['I_SEZ QUOTES']
+ colIdx = 0
+ for colNameIt in col_names:
+ sh.write(n, colIdx, colNameIt)
+ colIdx+=1
+ n+= 1
+
+ for idStr, textStr in devCommentaryTextInstance.getISEZTextEntriesList():
+ sh.write(n, 0, idStr)
+ objUTF8SafeStr = ""
+ for i in range(0, len(textStr)):
+ objUTF8SafeStr += textStr[i]
+ try:
+ objUTF8Unicode = unicode(objUTF8SafeStr, 'utf-8')
+ except Exception as e:
+ print '[Error] Failed to create unicode string: ' + str(e)
+ objUTF8Unicode = unicode("???", 'utf-8')
+ sh.write(n, 1, objUTF8Unicode)
+ n+=1
+ return
def inputMIXExtractTREs(inputMIXpath, excelOutBook = None):
print "[Info] Checking in %s for MIX files to extract Text Resources (TR%ss) from..." % (inputMIXpath, gActiveLanguageDescriptionCodeTuple[1])
@@ -557,6 +670,36 @@ def inputMIXExtractTREs(inputMIXpath, excelOutBook = None):
#print "[Error] while reading TR%s file %s into mem buffer" % (gActiveLanguageDescriptionCodeTuple[1], ''.join('{:08X}'.format(idOfMIXEntry)))
inMIXFile.close()
print "[Info] Total TR%ss processed: %d " % (gActiveLanguageDescriptionCodeTuple[1], totalTREs)
+ print "[Info] Adding POGO sheet..."
+ currTreFileName = '%s%s' % (SUPPORTED_SPECIAL_POGO_FILE, gActiveLanguageDescriptionCodeTuple[1]) # POGO
+ if gTraceModeEnabled:
+ print "[Debug] TR%s file %s was loaded successfully!" % (gActiveLanguageDescriptionCodeTuple[1], currTreFileName) # POGO
+ if excelOutBook != None:
+ sh = excelOutBook.add_sheet(currTreFileName)
+ n = 0 # keeps track of rows
+ col1_name = 'Text Resource File: %s' % (currTreFileName)
+ sh.write(n, 0, col1_name)
+ # Second Row
+ n = 1
+ col1_name = 'TextId'
+ col2_name = 'Text'
+ sh.write(n, 0, col1_name)
+ sh.write(n, 1, col2_name)
+ n+=1
+ pogoTRInstance = pogoTextResource(gTraceModeEnabled)
+
+ for m, e1 in enumerate(pogoTRInstance.getPogoEntriesList(), n):
+ sh.write(m, 0, e1[0])
+ objStr = e1[1]
+ objUTF8SafeStr = ""
+ for i in range(0, len(objStr)):
+ objUTF8SafeStr += objStr[i]
+ try:
+ objUTF8Unicode = unicode(objUTF8SafeStr, 'utf-8')
+ except Exception as e:
+ print '[Error] Failed to create unicode string: ' + str(e)
+ objUTF8Unicode = unicode("???", 'utf-8')
+ sh.write(m, 1, objUTF8Unicode)
return
@@ -656,16 +799,18 @@ def outputXLS(filename, sheet, list1, parseTREResourcesAlso = False, mixInputFol
# for m, e2 in enumerate(list2, n+1):
# sh.write(m, 1, e2)
+ appendVQAPlaceHolderSheets(book)
if parseTREResourcesAlso == True and mixInputFolderPath != '':
inputMIXExtractTREs(mixInputFolderPath, book)
- # TODO add sheets
- # TODO handle special string characters (to UTF-8)
+
+ appendDevCommentarySheet(book)
+
try:
book.save(filename)
print "[Info] Done."
except Exception as e:
- print "[Error] Could not save the output Excel file (maybe it's open?). " + str(e)
+ print "[Error] Could not save the output Excel file:: " + str(e)
#
# Aux function to validate input language description
@@ -924,7 +1069,7 @@ def main(argsCL):
# print "[Debug] Unique %s" % (filenameSrcTmp)
constructedOutputFilename = "%s-%s%s" % (OUTPUT_XLS_FILENAME, gActiveLanguageDescriptionCodeTuple[2], OUTPUT_XLS_FILENAME_EXT)
print "[Info] Creating output excel %s file..." % (constructedOutputFilename)
- outputXLS(constructedOutputFilename, OUTPUT_XLS_QUOTES_SHEET + gActiveLanguageDescriptionCodeTuple[1], gWavFilesNoDups, extractTreFilesMode, TMProotFolderWithInputTLKFiles)
+ outputXLS(constructedOutputFilename, OUTPUT_XLS_QUOTES_SHEET + gActiveLanguageDescriptionCodeTuple[1] + '.TR' + gActiveLanguageDescriptionCodeTuple[1], gWavFilesNoDups, extractTreFilesMode, TMProotFolderWithInputTLKFiles)
else:
invalidSyntax = True