# HG changeset patch # User casties # Date 1383067169 -3600 # Node ID 4342a81e0aa0abeecc0ec860c51abe5ac39e763e # Parent a8907351ddf2fe09242e067c1167488917d21992 make getTagsAsHash not return empty lists. diff -r a8907351ddf2 -r 4342a81e0aa0 MPIWGThesaurus.py --- a/MPIWGThesaurus.py Tue Oct 29 16:47:36 2013 +0100 +++ b/MPIWGThesaurus.py Tue Oct 29 18:19:29 2013 +0100 @@ -729,12 +729,14 @@ tagTypes = [tagType] for tagType in tagTypes: - retHash[tagType]=[] tagsStored=tags.get(tagType,None) if tagsStored is None: - return; + # WTF: was: return + continue + retHash[tagType]=[] + for tag in tagsStored.keys(): #gehe durch alle gespeichteren approached logging.debug("checking:"+tag) currentTag = tagsStored.get(tag,None) @@ -743,6 +745,10 @@ if currentTag.has_key(projectID): tagCnt+=1 retHash[tagType].append("""%s"""%tag) + + if len(retHash[tagType]) == 0: + # empty tag list + del retHash[tagType] if tagCnt==0: return None