From bd93d6d7008ed7d6eabd8f5df3d37e6f969cb183 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 17 Nov 2020 11:11:25 +0100 Subject: Gracefully handle pending releases without dates --- lv2specgen/lv2specgen.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index e3948f1..14c88c3 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -1275,14 +1275,24 @@ def writeIndex(model, specloc, index_path, root_path, root_uri, online): break # Verify that this date is the latest - for r in model.triples([ext_node, doap.release, None]): - this_date = model.value(r[2], doap.created, None) - if this_date > date: - print( - "warning: %s revision %d.%d (%s) is not the latest release" - % (ext_node, minor, micro, date) - ) - break + if date is None: + print("warning: %s has no doap:created date" % ext_node) + else: + for r in model.triples([ext_node, doap.release, None]): + this_date = model.value(r[2], doap.created, None) + if this_date is None: + print( + "warning: %s has no doap:created date" + % (ext_node, minor, micro, date) + ) + continue + + if this_date > date: + print( + "warning: %s revision %d.%d (%s) is not the latest release" + % (ext_node, minor, micro, date) + ) + break # Get name and short description name = model.value(ext_node, doap.name, None) -- cgit v1.2.1