Use True/False instead of 1/0
diff --git a/Lib/fontTools/ttLib/__init__.py b/Lib/fontTools/ttLib/__init__.py
index 93e0c90..5005cd4 100644
--- a/Lib/fontTools/ttLib/__init__.py
+++ b/Lib/fontTools/ttLib/__init__.py
@@ -71,7 +71,7 @@
def __init__(self, file=None, res_name_or_index=None,
sfntVersion="\000\001\000\000", flavor=None, checkChecksums=0,
verbose=0, recalcBBoxes=1, allowVID=0, ignoreDecompileErrors=False,
- fontNumber=-1, quiet=0):
+ fontNumber=-1, quiet=False):
"""The constructor can be called with a few different arguments.
When reading a font from disk, 'file' should be either a pathname
@@ -216,8 +216,8 @@
if closeStream:
file.close()
- def saveXML(self, fileOrPath, progress=None, quiet=None,
- tables=None, skipTables=None, splitTables=0, disassembleInstructions=1,
+ def saveXML(self, fileOrPath, progress=None, quiet=False,
+ tables=None, skipTables=None, splitTables=False, disassembleInstructions=True,
bitmapGlyphDataFormat='raw'):
"""Export the font as TTX (an XML-based text file), or as a series of text
files when splitTables is true. In the latter case, the 'fileOrPath'
@@ -314,7 +314,7 @@
writer.newline()
writer.newline()
- def importXML(self, file, progress=None, quiet=None):
+ def importXML(self, file, progress=None, quiet=False):
"""Import a TTX file (an XML-based text format), so as to recreate
a font object.
"""
diff --git a/Lib/fontTools/ttLib/xmlImport.py b/Lib/fontTools/ttLib/xmlImport.py
index f53fb1b..f4d9915 100644
--- a/Lib/fontTools/ttLib/xmlImport.py
+++ b/Lib/fontTools/ttLib/xmlImport.py
@@ -11,7 +11,7 @@
class ExpatParser:
- def __init__(self, ttFont, fileName, progress=None, quiet=None):
+ def __init__(self, ttFont, fileName, progress=None, quiet=False):
self.ttFont = ttFont
self.fileName = fileName
self.progress = progress
@@ -125,7 +125,7 @@
print text
-def importXML(ttFont, fileName, progress=None, quiet=None):
+def importXML(ttFont, fileName, progress=None, quiet=True):
"""Import a TTX file (an XML-based text format), so as to recreate
a font object.
"""
diff --git a/Lib/fontTools/ttx.py b/Lib/fontTools/ttx.py
index aa5655e..0efa0c0 100644
--- a/Lib/fontTools/ttx.py
+++ b/Lib/fontTools/ttx.py
@@ -100,16 +100,16 @@
class Options:
- listTables = 0
+ listTables = False
outputDir = None
outputFile = None
- verbose = 0
- quiet = 0
- splitTables = 0
- disassembleInstructions = 1
+ verbose = False
+ quiet = False
+ splitTables = False
+ disassembleInstructions = True
mergeFile = None
- recalcBBoxes = 1
- allowVID = 0
+ recalcBBoxes = True
+ allowVID = False
ignoreDecompileErrors = True
bitmapGlyphDataFormat = 'raw'
@@ -130,20 +130,20 @@
elif option == "-o":
self.outputFile = value
elif option == "-v":
- self.verbose = 1
+ self.verbose = True
elif option == "-q":
- self.quiet = 1
+ self.quiet = True
# dump options
elif option == "-l":
- self.listTables = 1
+ self.listTables = True
elif option == "-t":
self.onlyTables.append(value)
elif option == "-x":
self.skipTables.append(value)
elif option == "-s":
- self.splitTables = 1
+ self.splitTables = True
elif option == "-i":
- self.disassembleInstructions = 0
+ self.disassembleInstructions = False
elif option == "-z":
validOptions = ('raw', 'row', 'bitwise', 'extfile')
if value not in validOptions:
@@ -156,9 +156,9 @@
elif option == "-m":
self.mergeFile = value
elif option == "-b":
- self.recalcBBoxes = 0
+ self.recalcBBoxes = False
elif option == "-a":
- self.allowVID = 1
+ self.allowVID = True
elif option == "-e":
self.ignoreDecompileErrors = False
if self.onlyTables and self.skipTables:
@@ -198,9 +198,9 @@
ignoreDecompileErrors=options.ignoreDecompileErrors,
fontNumber=options.fontNumber)
ttf.saveXML(output,
- quiet=options.quiet,
+ quiet=options.quiet,
tables=options.onlyTables,
- skipTables=options.skipTables,
+ skipTables=options.skipTables,
splitTables=options.splitTables,
disassembleInstructions=options.disassembleInstructions,
bitmapGlyphDataFormat=options.bitmapGlyphDataFormat)