diff options
Diffstat (limited to 'devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator')
5 files changed, 118 insertions, 15 deletions
diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py index 2c87108479..9fc3b25a2b 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileDecode.py @@ -1,7 +1,27 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 -*- # -import ctypes +ctypesLibFound = False +structLibFound = False + +try: + import ctypes +except ImportError: + print "Error:: ctypes python library is required to be installed!" +else: + ctypesLibFound = True + +try: + import struct +except ImportError: + print "Error:: struct python library is required to be installed!" +else: + structLibFound = True + +if (not ctypesLibFound) or (not structLibFound): + sys.stdout.write("Error:: Errors were found when trying to import required python libraries\n") + sys.exit(1) + from struct import * my_module_version = "0.50" diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py index 682a31e16c..a771435a02 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/audFileLib.py @@ -1,12 +1,47 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 -*- # -import os, sys, shutil -import wave -import struct +import os, sys + +shutilLibFound = False +waveLibFound = False +ctypesLibFound = False +structLibFound = False + +try: + import shutil +except ImportError: + print "Error:: Shutil python library is required to be installed!" +else: + shutilLibFound = True + +try: + import wave +except ImportError: + print "Error:: Wave python library is required to be installed!" +else: + waveLibFound = True + +try: + import ctypes +except ImportError: + print "Error:: ctypes python library is required to be installed!" +else: + ctypesLibFound = True + +try: + import struct +except ImportError: + print "Error:: struct python library is required to be installed!" +else: + structLibFound = True + +if (not shutilLibFound) or (not waveLibFound) or (not ctypesLibFound) or (not structLibFound): + sys.stdout.write("Error:: Errors were found when trying to import required python libraries\n") + sys.exit(1) + from struct import * from audFileDecode import * -import ctypes my_module_version = "0.50" my_module_name = "audFileLib" diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py index c1bdc84413..04c50e52cc 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/quoteSpreadsheetCreator.py @@ -2,9 +2,9 @@ # -*- coding: UTF-8 -*- import sys if not (sys.version_info[0] == 2 and sys.version_info[1] == 7): - sys.stdout.write("Error:: Blade Runner Quotes Spreadsheet Creator script requires Python 2.7\n") - sys.exit(1) + sys.stdout.write("Error:: Blade Runner Quotes Spreadsheet Creator script requires Python 2.7\n") + sys.exit(1) import sortBladeRunnerWavs02 if __name__ == "__main__": - sortBladeRunnerWavs02.main(sys.argv[0:])
\ No newline at end of file + sortBladeRunnerWavs02.main(sys.argv[0:])
\ 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 b3f368ed40..0e0cf47ee0 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/sortBladeRunnerWavs02.py @@ -10,11 +10,38 @@ # DONE Add code and switch option: to get the blade runner installation directory as input, then find the TLK files and extract them with proper naming # DONE fix proper names for sheets as per latest code changes # -import os, sys, shutil -from os import walk, errno -import xlwt -import csv -import os.path +import os, sys + +shutilLibFound = False +xlwtLibFound = False +csvLibFound = False + +try: + import shutil +except ImportError: + print "Error:: Shutil python library is required to be installed!" +else: + shutilLibFound = True + +try: + import xlwt +except ImportError: + print "Error:: xlwt python library is required to be installed!" +else: + xlwtLibFound = True + +try: + import csv +except ImportError: + print "Error:: csv python library is required to be installed!" +else: + csvLibFound = True + +if (not shutilLibFound) or (not structLibFound) or (not csvLibFound): + sys.stdout.write("Error:: Errors were found when trying to import required python libraries\n") + sys.exit(1) + +from os import walk, errno, path from xlwt import * from audFileLib import * from treFileLib import * diff --git a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py index 29eac6a8e5..11f666132c 100644 --- a/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py +++ b/devtools/create_bladerunner/subtitles/quotesSpreadsheetCreator/treFileLib.py @@ -1,8 +1,29 @@ #!/usr/bin/env python2.7 # -*- coding: UTF-8 -*- # -import os, sys, shutil -import struct +import os, sys + +shutilLibFound = False +structLibFound = False + +try: + import shutil +except ImportError: + print "Error:: Shutil python library is required to be installed!" +else: + shutilLibFound = True + +try: + import struct +except ImportError: + print "Error:: struct python library is required to be installed!" +else: + structLibFound = True + +if (not shutilLibFound) or (not structLibFound): + sys.stdout.write("Error:: Errors were found when trying to import required python libraries\n") + sys.exit(1) + from struct import * my_module_version = "0.50" |