comparison MPIWGThesaurus.py @ 36:e13200d8d473

getTags retruns now None if there aren't any
author dwinter
date Thu, 24 Oct 2013 14:58:45 +0200
parents cfb5bb05253a
children a8907351ddf2
comparison
equal deleted inserted replaced
35:cfb5bb05253a 36:e13200d8d473
711 self.tagList=self.getEntriesFromTxt(self.approachesTxt) 711 self.tagList=self.getEntriesFromTxt(self.approachesTxt)
712 return self.tagList 712 return self.tagList
713 713
714 714
715 def getTagsAsHash(self,projectID,tagType=None): 715 def getTagsAsHash(self,projectID,tagType=None):
716 """get all tags""" 716 """get all tags as hash or None if no tag exists"""
717 retHash={} 717 retHash={}
718 718
719 tagCnt=0
719 tags = getattr(self,"tags",None) 720 tags = getattr(self,"tags",None)
720 721
721 if tags is None: 722 if tags is None:
722 return; 723 return;
723 724
738 logging.debug("checking:"+tag) 739 logging.debug("checking:"+tag)
739 currentTag = tagsStored.get(tag,None) 740 currentTag = tagsStored.get(tag,None)
740 if currentTag is None: 741 if currentTag is None:
741 continue 742 continue
742 if currentTag.has_key(projectID): 743 if currentTag.has_key(projectID):
744 tagCnt+=1
743 retHash[tagType].append("""%s"""%tag) 745 retHash[tagType].append("""%s"""%tag)
744 746
745 logging.debug(retHash) 747 if tagCnt==0:
748 return None
749
746 return retHash 750 return retHash
747 751
748 752
749 753
750 754