From 5dabba669989b534949aae2ccbfbb1bedc4fc4e2 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Tue, 27 Sep 2016 00:28:01 +0100 Subject: [PATCH] [ttLib] get 'ttLibVersion' from fontTools.version.__version__, but only write MAJOR.MINOR otherwise it risks changing too often... ;) --- Lib/fontTools/ttLib/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/fontTools/ttLib/__init__.py b/Lib/fontTools/ttLib/__init__.py index 1a62687ab..fd13f5f97 100644 --- a/Lib/fontTools/ttLib/__init__.py +++ b/Lib/fontTools/ttLib/__init__.py @@ -250,9 +250,13 @@ class TTFont(object): list of tables to dump. The 'skipTables' argument may be a list of tables to skip, but only when the 'tables' argument is false. """ - from fontTools import version + from fontTools.version import __version__ from fontTools.misc import xmlWriter + # only write the MAJOR.MINOR version in the 'ttLibVersion' attribute of + # TTX files' root element (without PATCH or .dev suffixes) + version = ".".join(__version__.split('.')[:2]) + if quiet is not None: deprecateArgument("quiet", "configure logging instead")