From fed04a0429d68d65f26804997804d1bf27b5b865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 6 Sep 2013 22:38:36 +0200 Subject: [PATCH] Don't print all metadata reads; Only print when an exception is present --- fdroidserver/common.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 51f9a955..50319c3c 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -464,8 +464,6 @@ def parse_metadata(metafile, **kw): if not isinstance(metafile, file): metafile = open(metafile, "r") thisinfo['id'] = metafile.name[9:-4] - if kw.get("verbose", False): - print "Reading metadata for " + thisinfo['id'] else: thisinfo['id'] = None @@ -674,7 +672,11 @@ def write_metadata(dest, app): def read_metadata(verbose=False, xref=True): apps = [] for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))): - apps.append(parse_metadata(metafile, verbose=verbose)) + try: + appinfo = parse_metadata(metafile, verbose=verbose) + except Exception, e: + raise MetaDataException("Problem reading metadata file %s: - %s" % (metafile, str(e))) + apps.append(appinfo) if xref: # Parse all descriptions at load time, just to ensure cross-referencing