From 5cd4e51450bc081cdbf533b7a1f6981c5b2e946f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 14 Apr 2015 00:17:52 -0700 Subject: [PATCH] Update MetaTools/buildTableList.py for recent changes --- Lib/fontTools/ttLib/tables/__init__.py | 1 + MetaTools/buildTableList.py | 21 ++++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/__init__.py b/Lib/fontTools/ttLib/tables/__init__.py index 253f6a286..5541abc57 100644 --- a/Lib/fontTools/ttLib/tables/__init__.py +++ b/Lib/fontTools/ttLib/tables/__init__.py @@ -1,3 +1,4 @@ + # DON'T EDIT! This file is generated by MetaTools/buildTableList.py. def _moduleFinderHint(): """Dummy function to let modulefinder know what tables may be diff --git a/MetaTools/buildTableList.py b/MetaTools/buildTableList.py index 1e77492dc..0153ec726 100755 --- a/MetaTools/buildTableList.py +++ b/MetaTools/buildTableList.py @@ -31,14 +31,25 @@ tables.sort() file = open(os.path.join(tablesDir, "__init__.py"), "w") -file.write("# DON'T EDIT! This file is generated by MetaTools/buildTableList.py.\n") -file.write("def _moduleFinderHint():\n") -file.write('\t"""Dummy function to let modulefinder know what tables may be\n') -file.write('\tdynamically imported. Generated by MetaTools/buildTableList.py.\n') -file.write('\t"""\n') +file.write(''' +# DON'T EDIT! This file is generated by MetaTools/buildTableList.py. +def _moduleFinderHint(): + """Dummy function to let modulefinder know what tables may be + dynamically imported. Generated by MetaTools/buildTableList.py. + + >>> _moduleFinderHint() + """ +''') + for module in modules: file.write("\tfrom . import %s\n" % module) +file.write(''' +if __name__ == "__main__": + import doctest, sys + sys.exit(doctest.testmod().failed) +''') + file.close()