diff 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
line wrap: on
line diff
--- a/MPIWGThesaurus.py	Thu Oct 24 14:46:22 2013 +0200
+++ b/MPIWGThesaurus.py	Thu Oct 24 14:58:45 2013 +0200
@@ -713,9 +713,10 @@
     
   
     def getTagsAsHash(self,projectID,tagType=None):
-        """get all  tags"""
+        """get all  tags as hash or None if no tag exists"""
         retHash={}
         
+        tagCnt=0
         tags = getattr(self,"tags",None)
         
         if tags is None:
@@ -740,9 +741,12 @@
                 if currentTag is None:
                     continue
                 if currentTag.has_key(projectID):
+                    tagCnt+=1
                     retHash[tagType].append("""%s"""%tag)
             
-        logging.debug(retHash)
+        if tagCnt==0:
+            return None
+        
         return retHash