From f46f893de9a38d6f8d6d64d9858d104ea91039d8 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 25 Oct 2011 13:58:55 +0000 Subject: [PATCH] Don't try to output draft metadata (in standalone mode) for a file if the extraction failed. - Legacy-Id: 3505 --- ietf/utils/draft.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ietf/utils/draft.py b/ietf/utils/draft.py index f2dd51bc3..d032f435c 100755 --- a/ietf/utils/draft.py +++ b/ietf/utils/draft.py @@ -770,7 +770,7 @@ def getmeta(fn): filename = os.path.join("/www/tools.ietf.org/id", fn) if not os.path.exists(filename): _warn("Could not find file: '%s'" % (filename)) - return + return None timestamp = time.strftime("%Y-%m-%dT%H:%M:%S+00:00", time.gmtime(os.stat(filename)[stat.ST_MTIME])) text = _gettext(filename) @@ -822,7 +822,8 @@ def _printmeta(timestamp, fn, outfile=sys.stdout): sys.stderr.write("%-58s" % fn[:-4]) fields = getmeta(fn) - _output(fields.get("doctag", fn[:-7]), fields, outfile) + if fields: + _output(fields.get("doctag", fn[:-7]), fields, outfile) if opt_trace: sys.stderr.write("%5.1f\n" % ((time.time() - t)))