2002-09-12 17:33:12 +00:00
|
|
|
"""\
|
|
|
|
usage: ttx [options] inputfile1 [... inputfileN]
|
|
|
|
|
|
|
|
TTX %s -- From OpenType To XML And Back
|
|
|
|
|
|
|
|
If an input file is a TrueType or OpenType font file, it will be
|
|
|
|
dumped to an TTX file (an XML-based text format).
|
|
|
|
If an input file is a TTX file, it will be compiled to a TrueType
|
|
|
|
or OpenType font file.
|
|
|
|
|
|
|
|
Output files are created so they are unique: an existing file is
|
2011-10-30 12:26:09 +00:00
|
|
|
never overwritten.
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
General options:
|
|
|
|
-h Help: print this message
|
|
|
|
-d <outputfolder> Specify a directory where the output files are
|
|
|
|
to be created.
|
2014-06-27 11:20:59 -07:00
|
|
|
-o <outputfile> Specify a file to write the output to. A special
|
|
|
|
value of of - would use the standard output.
|
2015-01-06 03:02:30 +01:00
|
|
|
-f Overwrite existing output file(s), ie. don't append numbers.
|
2002-09-12 17:33:12 +00:00
|
|
|
-v Verbose: more messages will be written to stdout about what
|
|
|
|
is being done.
|
2013-09-04 13:16:39 +01:00
|
|
|
-q Quiet: No messages will be written to stdout about what
|
|
|
|
is being done.
|
2006-10-21 14:12:38 +00:00
|
|
|
-a allow virtual glyphs ID's on compile or decompile.
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
Dump options:
|
|
|
|
-l List table info: instead of dumping to a TTX file, list some
|
|
|
|
minimal info about each table.
|
|
|
|
-t <table> Specify a table to dump. Multiple -t options
|
|
|
|
are allowed. When no -t option is specified, all tables
|
|
|
|
will be dumped.
|
|
|
|
-x <table> Specify a table to exclude from the dump. Multiple
|
|
|
|
-x options are allowed. -t and -x are mutually exclusive.
|
|
|
|
-s Split tables: save the TTX data into separate TTX files per
|
|
|
|
table and write one small TTX file that contains references
|
|
|
|
to the individual table dumps. This file can be used as
|
|
|
|
input to ttx, as long as the table files are in the
|
|
|
|
same directory.
|
|
|
|
-i Do NOT disassemble TT instructions: when this option is given,
|
|
|
|
all TrueType programs (glyph programs, the font program and the
|
|
|
|
pre-program) will be written to the TTX file as hex data
|
|
|
|
instead of assembly. This saves some time and makes the TTX
|
|
|
|
file smaller.
|
2013-08-09 13:25:15 -07:00
|
|
|
-z <format> Specify a bitmap data export option for EBDT:
|
|
|
|
{'raw', 'row', 'bitwise', 'extfile'} or for the CBDT:
|
|
|
|
{'raw', 'extfile'} Each option does one of the following:
|
|
|
|
-z raw
|
|
|
|
* export the bitmap data as a hex dump
|
|
|
|
-z row
|
|
|
|
* export each row as hex data
|
|
|
|
-z bitwise
|
|
|
|
* export each row as binary in an ASCII art style
|
|
|
|
-z extfile
|
2014-08-19 12:40:12 -04:00
|
|
|
* export the data as external files with XML references
|
2013-08-09 13:25:15 -07:00
|
|
|
If no export format is specified 'raw' format is used.
|
2008-03-01 09:42:58 +00:00
|
|
|
-e Don't ignore decompilation errors, but show a full traceback
|
|
|
|
and abort.
|
2009-11-08 15:53:24 +00:00
|
|
|
-y <number> Select font number for TrueType Collection,
|
2009-02-22 08:55:00 +00:00
|
|
|
starting from 0.
|
2015-05-23 18:56:33 +01:00
|
|
|
--unicodedata <UnicodeData.txt> Use custom database file to write
|
|
|
|
character names in the comments of the cmap TTX output.
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
Compile options:
|
|
|
|
-m Merge with TrueType-input-file: specify a TrueType or OpenType
|
|
|
|
font file to be merged with the TTX file. This option is only
|
|
|
|
valid when at most one TTX file is specified.
|
2011-10-30 12:26:09 +00:00
|
|
|
-b Don't recalc glyph bounding boxes: use the values in the TTX
|
2002-09-12 17:33:12 +00:00
|
|
|
file as-is.
|
2015-05-23 20:40:27 +01:00
|
|
|
--recalc-timestamp Set font 'modified' timestamp to current time.
|
|
|
|
By default, the modification time of the TTX file will be used.
|
2002-09-12 17:33:12 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
2014-01-14 15:07:50 +08:00
|
|
|
from __future__ import print_function, division, absolute_import
|
2013-11-27 17:27:45 -05:00
|
|
|
from fontTools.misc.py23 import *
|
2013-11-19 10:32:09 +01:00
|
|
|
from fontTools.ttLib import TTFont, TTLibError
|
2008-03-01 11:34:54 +00:00
|
|
|
from fontTools.misc.macCreatorType import getMacCreatorAndType
|
2015-05-23 18:56:33 +01:00
|
|
|
from fontTools.unicode import setUnicodeData
|
2015-05-23 20:40:27 +01:00
|
|
|
from fontTools.misc.timeTools import timestampSinceEpoch
|
2013-11-27 17:27:45 -05:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import getopt
|
|
|
|
import re
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
def usage():
|
2013-12-04 01:15:46 -05:00
|
|
|
from fontTools import version
|
2013-11-27 04:57:33 -05:00
|
|
|
print(__doc__ % version)
|
2002-09-12 17:33:12 +00:00
|
|
|
sys.exit(2)
|
|
|
|
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2013-11-01 00:43:06 +00:00
|
|
|
numberAddedRE = re.compile("#\d+$")
|
2013-06-22 08:16:33 +00:00
|
|
|
opentypeheaderRE = re.compile('''sfntVersion=['"]OTTO["']''')
|
2002-09-12 17:33:12 +00:00
|
|
|
|
2015-04-20 11:50:37 -07:00
|
|
|
def makeOutputFileName(input, outputDir, extension, overWrite=False):
|
2013-12-04 01:15:46 -05:00
|
|
|
dirName, fileName = os.path.split(input)
|
|
|
|
fileName, ext = os.path.splitext(fileName)
|
2002-09-12 17:33:12 +00:00
|
|
|
if outputDir:
|
2013-12-04 01:15:46 -05:00
|
|
|
dirName = outputDir
|
|
|
|
fileName = numberAddedRE.split(fileName)[0]
|
|
|
|
output = os.path.join(dirName, fileName + extension)
|
2002-09-12 17:33:12 +00:00
|
|
|
n = 1
|
2015-01-06 03:02:30 +01:00
|
|
|
if not overWrite:
|
|
|
|
while os.path.exists(output):
|
|
|
|
output = os.path.join(dirName, fileName + "#" + repr(n) + extension)
|
|
|
|
n = n + 1
|
2002-09-12 17:33:12 +00:00
|
|
|
return output
|
|
|
|
|
|
|
|
|
2013-11-28 14:26:58 -05:00
|
|
|
class Options(object):
|
2002-09-12 17:33:12 +00:00
|
|
|
|
2013-11-24 18:49:35 -05:00
|
|
|
listTables = False
|
2002-09-12 17:33:12 +00:00
|
|
|
outputDir = None
|
2013-06-22 06:43:01 +00:00
|
|
|
outputFile = None
|
2015-01-06 03:02:30 +01:00
|
|
|
overWrite = False
|
2013-11-24 18:49:35 -05:00
|
|
|
verbose = False
|
|
|
|
quiet = False
|
|
|
|
splitTables = False
|
|
|
|
disassembleInstructions = True
|
2002-09-12 17:33:12 +00:00
|
|
|
mergeFile = None
|
2013-11-24 18:49:35 -05:00
|
|
|
recalcBBoxes = True
|
|
|
|
allowVID = False
|
2008-03-01 09:42:58 +00:00
|
|
|
ignoreDecompileErrors = True
|
2013-08-09 13:25:15 -07:00
|
|
|
bitmapGlyphDataFormat = 'raw'
|
2015-05-23 18:56:33 +01:00
|
|
|
unicodedata = None
|
2015-05-23 20:40:27 +01:00
|
|
|
recalcTimestamp = False
|
2008-03-01 09:42:58 +00:00
|
|
|
|
2002-09-12 17:33:12 +00:00
|
|
|
def __init__(self, rawOptions, numFiles):
|
|
|
|
self.onlyTables = []
|
|
|
|
self.skipTables = []
|
2009-02-22 08:55:00 +00:00
|
|
|
self.fontNumber = -1
|
2002-09-12 17:33:12 +00:00
|
|
|
for option, value in rawOptions:
|
|
|
|
# general options
|
|
|
|
if option == "-h":
|
2013-12-04 01:15:46 -05:00
|
|
|
from fontTools import version
|
2013-11-27 04:57:33 -05:00
|
|
|
print(__doc__ % version)
|
2002-09-12 17:33:12 +00:00
|
|
|
sys.exit(0)
|
|
|
|
elif option == "-d":
|
|
|
|
if not os.path.isdir(value):
|
2013-11-27 04:57:33 -05:00
|
|
|
print("The -d option value must be an existing directory")
|
2002-09-12 17:33:12 +00:00
|
|
|
sys.exit(2)
|
|
|
|
self.outputDir = value
|
2013-06-22 06:43:01 +00:00
|
|
|
elif option == "-o":
|
|
|
|
self.outputFile = value
|
2015-01-06 03:02:30 +01:00
|
|
|
elif option == "-f":
|
|
|
|
self.overWrite = True
|
2002-09-12 17:33:12 +00:00
|
|
|
elif option == "-v":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.verbose = True
|
2013-09-04 13:16:39 +01:00
|
|
|
elif option == "-q":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.quiet = True
|
2002-09-12 17:33:12 +00:00
|
|
|
# dump options
|
|
|
|
elif option == "-l":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.listTables = True
|
2002-09-12 17:33:12 +00:00
|
|
|
elif option == "-t":
|
|
|
|
self.onlyTables.append(value)
|
|
|
|
elif option == "-x":
|
|
|
|
self.skipTables.append(value)
|
|
|
|
elif option == "-s":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.splitTables = True
|
2002-09-12 17:33:12 +00:00
|
|
|
elif option == "-i":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.disassembleInstructions = False
|
2013-08-09 13:25:15 -07:00
|
|
|
elif option == "-z":
|
|
|
|
validOptions = ('raw', 'row', 'bitwise', 'extfile')
|
|
|
|
if value not in validOptions:
|
2013-11-27 04:57:33 -05:00
|
|
|
print("-z does not allow %s as a format. Use %s" % (option, validOptions))
|
2013-08-09 13:25:15 -07:00
|
|
|
sys.exit(2)
|
|
|
|
self.bitmapGlyphDataFormat = value
|
2009-02-22 08:55:00 +00:00
|
|
|
elif option == "-y":
|
|
|
|
self.fontNumber = int(value)
|
2002-09-12 17:33:12 +00:00
|
|
|
# compile options
|
|
|
|
elif option == "-m":
|
|
|
|
self.mergeFile = value
|
|
|
|
elif option == "-b":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.recalcBBoxes = False
|
2006-10-21 14:12:38 +00:00
|
|
|
elif option == "-a":
|
2013-11-24 18:49:35 -05:00
|
|
|
self.allowVID = True
|
2008-03-01 09:42:58 +00:00
|
|
|
elif option == "-e":
|
|
|
|
self.ignoreDecompileErrors = False
|
2015-05-23 18:56:33 +01:00
|
|
|
elif option == "--unicodedata":
|
|
|
|
self.unicodedata = value
|
2015-05-23 20:40:27 +01:00
|
|
|
elif option == "--recalc-timestamp":
|
|
|
|
self.recalcTimestamp = True
|
2002-09-12 17:33:12 +00:00
|
|
|
if self.onlyTables and self.skipTables:
|
2013-11-27 04:57:33 -05:00
|
|
|
print("-t and -x options are mutually exclusive")
|
2002-09-12 17:33:12 +00:00
|
|
|
sys.exit(2)
|
|
|
|
if self.mergeFile and numFiles > 1:
|
2013-11-27 04:57:33 -05:00
|
|
|
print("Must specify exactly one TTX source file when using -m")
|
2002-09-12 17:33:12 +00:00
|
|
|
sys.exit(2)
|
|
|
|
|
|
|
|
|
|
|
|
def ttList(input, output, options):
|
2013-11-24 19:04:25 -05:00
|
|
|
ttf = TTFont(input, fontNumber=options.fontNumber, lazy=True)
|
2002-09-12 17:33:12 +00:00
|
|
|
reader = ttf.reader
|
2013-11-27 04:15:34 -05:00
|
|
|
tags = sorted(reader.keys())
|
2013-11-27 04:57:33 -05:00
|
|
|
print('Listing table info for "%s":' % input)
|
2002-09-12 17:33:12 +00:00
|
|
|
format = " %4s %10s %7s %7s"
|
2013-11-27 04:57:33 -05:00
|
|
|
print(format % ("tag ", " checksum", " length", " offset"))
|
|
|
|
print(format % ("----", "----------", "-------", "-------"))
|
2002-09-12 17:33:12 +00:00
|
|
|
for tag in tags:
|
|
|
|
entry = reader.tables[tag]
|
2015-07-31 20:01:31 +01:00
|
|
|
if ttf.flavor == "woff2":
|
|
|
|
# WOFF2 doesn't store table checksums, so they must be calculated
|
|
|
|
from fontTools.ttLib.sfnt import calcChecksum
|
|
|
|
data = entry.loadData(reader.transformBuffer)
|
|
|
|
checkSum = calcChecksum(data)
|
|
|
|
else:
|
|
|
|
checkSum = int(entry.checkSum)
|
2004-12-24 15:59:35 +00:00
|
|
|
if checkSum < 0:
|
2013-11-27 03:37:29 -05:00
|
|
|
checkSum = checkSum + 0x100000000
|
2013-11-27 05:47:34 -05:00
|
|
|
checksum = "0x%08X" % checkSum
|
2013-11-27 04:57:33 -05:00
|
|
|
print(format % (tag, checksum, entry.length, entry.offset))
|
|
|
|
print()
|
2002-09-12 17:33:12 +00:00
|
|
|
ttf.close()
|
|
|
|
|
|
|
|
|
|
|
|
def ttDump(input, output, options):
|
2013-09-04 13:16:39 +01:00
|
|
|
if not options.quiet:
|
2013-11-27 04:57:33 -05:00
|
|
|
print('Dumping "%s" to "%s"...' % (input, output))
|
2015-05-23 18:56:33 +01:00
|
|
|
if options.unicodedata:
|
|
|
|
setUnicodeData(options.unicodedata)
|
2008-03-01 09:42:58 +00:00
|
|
|
ttf = TTFont(input, 0, verbose=options.verbose, allowVID=options.allowVID,
|
2013-09-04 14:51:16 +01:00
|
|
|
quiet=options.quiet,
|
2009-02-22 08:55:00 +00:00
|
|
|
ignoreDecompileErrors=options.ignoreDecompileErrors,
|
|
|
|
fontNumber=options.fontNumber)
|
2002-09-12 17:33:12 +00:00
|
|
|
ttf.saveXML(output,
|
2013-11-24 18:49:35 -05:00
|
|
|
quiet=options.quiet,
|
2002-09-12 17:33:12 +00:00
|
|
|
tables=options.onlyTables,
|
2013-11-24 18:49:35 -05:00
|
|
|
skipTables=options.skipTables,
|
2002-09-12 17:33:12 +00:00
|
|
|
splitTables=options.splitTables,
|
2013-08-09 13:25:15 -07:00
|
|
|
disassembleInstructions=options.disassembleInstructions,
|
|
|
|
bitmapGlyphDataFormat=options.bitmapGlyphDataFormat)
|
2002-09-12 17:33:12 +00:00
|
|
|
ttf.close()
|
|
|
|
|
|
|
|
|
|
|
|
def ttCompile(input, output, options):
|
2013-09-04 13:30:21 +01:00
|
|
|
if not options.quiet:
|
2013-11-27 04:57:33 -05:00
|
|
|
print('Compiling "%s" to "%s"...' % (input, output))
|
2002-09-12 17:33:12 +00:00
|
|
|
ttf = TTFont(options.mergeFile,
|
|
|
|
recalcBBoxes=options.recalcBBoxes,
|
2015-05-23 20:40:27 +01:00
|
|
|
recalcTimestamp=options.recalcTimestamp,
|
2006-10-21 14:12:38 +00:00
|
|
|
verbose=options.verbose, allowVID=options.allowVID)
|
2013-09-04 13:30:21 +01:00
|
|
|
ttf.importXML(input, quiet=options.quiet)
|
2015-05-23 20:40:27 +01:00
|
|
|
|
|
|
|
if not options.recalcTimestamp:
|
|
|
|
# use TTX file modification time for head "modified" timestamp
|
|
|
|
mtime = os.path.getmtime(input)
|
|
|
|
ttf['head'].modified = timestampSinceEpoch(mtime)
|
|
|
|
|
2013-12-20 21:52:28 -05:00
|
|
|
ttf.save(output)
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
if options.verbose:
|
|
|
|
import time
|
2013-11-27 04:57:33 -05:00
|
|
|
print("finished at", time.strftime("%H:%M:%S", time.localtime(time.time())))
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
def guessFileType(fileName):
|
2003-08-22 18:50:44 +00:00
|
|
|
base, ext = os.path.splitext(fileName)
|
2002-09-12 17:33:12 +00:00
|
|
|
try:
|
|
|
|
f = open(fileName, "rb")
|
|
|
|
except IOError:
|
|
|
|
return None
|
2008-03-01 11:34:54 +00:00
|
|
|
cr, tp = getMacCreatorAndType(fileName)
|
|
|
|
if tp in ("sfnt", "FFIL"):
|
|
|
|
return "TTF"
|
|
|
|
if ext == ".dfont":
|
|
|
|
return "TTF"
|
2002-09-12 17:33:12 +00:00
|
|
|
header = f.read(256)
|
2013-11-27 16:44:53 -05:00
|
|
|
head = Tag(header[:4])
|
2002-09-12 17:33:12 +00:00
|
|
|
if head == "OTTO":
|
|
|
|
return "OTF"
|
2009-02-22 08:55:00 +00:00
|
|
|
elif head == "ttcf":
|
|
|
|
return "TTC"
|
2002-09-12 17:33:12 +00:00
|
|
|
elif head in ("\0\1\0\0", "true"):
|
|
|
|
return "TTF"
|
2013-11-27 16:44:53 -05:00
|
|
|
elif head == "wOFF":
|
2013-11-26 12:58:28 -05:00
|
|
|
return "WOFF"
|
2015-07-31 20:01:31 +01:00
|
|
|
elif head == "wOF2":
|
|
|
|
return "WOFF2"
|
2002-09-12 17:33:12 +00:00
|
|
|
elif head.lower() == "<?xm":
|
2013-11-28 06:46:59 -05:00
|
|
|
# Use 'latin1' because that can't fail.
|
|
|
|
header = tostr(header, 'latin1')
|
2013-11-01 00:43:06 +00:00
|
|
|
if opentypeheaderRE.search(header):
|
2002-09-12 17:33:12 +00:00
|
|
|
return "OTX"
|
|
|
|
else:
|
|
|
|
return "TTX"
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
|
def parseOptions(args):
|
|
|
|
try:
|
2015-05-23 18:56:33 +01:00
|
|
|
rawOptions, files = getopt.getopt(args, "ld:o:fvqht:x:sim:z:baey:",
|
2015-05-23 20:40:27 +01:00
|
|
|
['unicodedata=', "recalc-timestamp"])
|
2002-09-12 17:33:12 +00:00
|
|
|
except getopt.GetoptError:
|
|
|
|
usage()
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2002-09-12 17:33:12 +00:00
|
|
|
if not files:
|
|
|
|
usage()
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2002-09-12 17:33:12 +00:00
|
|
|
options = Options(rawOptions, len(files))
|
|
|
|
jobs = []
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2002-09-12 17:33:12 +00:00
|
|
|
for input in files:
|
|
|
|
tp = guessFileType(input)
|
2015-07-31 20:01:31 +01:00
|
|
|
if tp in ("OTF", "TTF", "TTC", "WOFF", "WOFF2"):
|
2002-09-12 17:33:12 +00:00
|
|
|
extension = ".ttx"
|
|
|
|
if options.listTables:
|
|
|
|
action = ttList
|
|
|
|
else:
|
|
|
|
action = ttDump
|
|
|
|
elif tp == "TTX":
|
|
|
|
extension = ".ttf"
|
|
|
|
action = ttCompile
|
|
|
|
elif tp == "OTX":
|
|
|
|
extension = ".otf"
|
|
|
|
action = ttCompile
|
|
|
|
else:
|
2013-11-27 04:57:33 -05:00
|
|
|
print('Unknown file type: "%s"' % input)
|
2002-09-12 17:33:12 +00:00
|
|
|
continue
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2013-06-22 06:43:01 +00:00
|
|
|
if options.outputFile:
|
|
|
|
output = options.outputFile
|
|
|
|
else:
|
2015-01-06 03:02:30 +01:00
|
|
|
output = makeOutputFileName(input, options.outputDir, extension, options.overWrite)
|
2015-05-23 21:14:54 +01:00
|
|
|
# 'touch' output file to avoid race condition in choosing file names
|
2015-06-23 11:15:56 +01:00
|
|
|
if action != ttList:
|
|
|
|
open(output, 'a').close()
|
2002-09-12 17:33:12 +00:00
|
|
|
jobs.append((action, input, output))
|
2002-09-12 20:05:23 +00:00
|
|
|
return jobs, options
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
def process(jobs, options):
|
|
|
|
for action, input, output in jobs:
|
|
|
|
action(input, output, options)
|
|
|
|
|
|
|
|
|
|
|
|
def waitForKeyPress():
|
|
|
|
"""Force the DOS Prompt window to stay open so the user gets
|
|
|
|
a chance to see what's wrong."""
|
|
|
|
import msvcrt
|
2013-11-27 04:57:33 -05:00
|
|
|
print('(Hit any key to exit)')
|
2002-09-12 17:33:12 +00:00
|
|
|
while not msvcrt.kbhit():
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2015-05-20 11:02:43 +01:00
|
|
|
def main(args=None):
|
|
|
|
if args is None:
|
|
|
|
args = sys.argv[1:]
|
2002-09-12 17:33:12 +00:00
|
|
|
jobs, options = parseOptions(args)
|
|
|
|
try:
|
|
|
|
process(jobs, options)
|
|
|
|
except KeyboardInterrupt:
|
2013-11-27 04:57:33 -05:00
|
|
|
print("(Cancelled.)")
|
2002-09-12 17:33:12 +00:00
|
|
|
except SystemExit:
|
|
|
|
if sys.platform == "win32":
|
|
|
|
waitForKeyPress()
|
|
|
|
else:
|
|
|
|
raise
|
2013-11-27 05:09:00 -05:00
|
|
|
except TTLibError as e:
|
2013-11-27 04:57:33 -05:00
|
|
|
print("Error:",e)
|
2002-09-12 17:33:12 +00:00
|
|
|
except:
|
|
|
|
if sys.platform == "win32":
|
|
|
|
import traceback
|
|
|
|
traceback.print_exc()
|
|
|
|
waitForKeyPress()
|
|
|
|
else:
|
|
|
|
raise
|
2015-04-26 02:01:01 -04:00
|
|
|
|
2002-09-12 17:33:12 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2015-05-20 11:02:43 +01:00
|
|
|
main()
|