From 0ecc43373669b195d11fb8fa6f3750aec1e6ad25 Mon Sep 17 00:00:00 2001 From: jvr Date: Wed, 15 May 2002 07:50:06 +0000 Subject: [PATCH] ignore tables we don't have upon saving as XML: this is indispensible for batch processing git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@237 4cde692c-a291-49d1-8350-778aa11640f8 --- Lib/fontTools/ttLib/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/ttLib/__init__.py b/Lib/fontTools/ttLib/__init__.py index a0fa6a5ab..58e16c4e6 100644 --- a/Lib/fontTools/ttLib/__init__.py +++ b/Lib/fontTools/ttLib/__init__.py @@ -42,7 +42,7 @@ Dumping 'prep' table... """ # -# $Id: __init__.py,v 1.27 2002-05-13 16:21:50 jvr Exp $ +# $Id: __init__.py,v 1.28 2002-05-15 07:50:06 jvr Exp $ # import os @@ -212,14 +212,19 @@ class TTFont: writer.newline() collection.simpletag(xmlTag, src=os.path.basename(tablePath)) collection.newline() - table = self[tag] - report = "Dumping '%s' table..." % tag + if self.has_key(tag): + table = self[tag] + report = "Dumping '%s' table..." % tag + else: + report = "No '%s' table found." % tag if progress: progress.setlabel(report) elif self.verbose: debugmsg(report) else: print report + if not self.has_key(tag): + continue if hasattr(table, "ERROR"): writer.begintag(xmlTag, ERROR="decompilation error") else: