changeset 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 ca608b31ec8d
files .pydevproject MPIWGThesaurus.py
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.pydevproject	Thu Oct 24 14:46:22 2013 +0200
+++ b/.pydevproject	Thu Oct 24 14:58:45 2013 +0200
@@ -2,8 +2,8 @@
 <?eclipse-pydev version="1.0"?>
 
 <pydev_project>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">python2.4 - zope</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.4</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
 <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
 <path>/MPIWGThesaurus</path>
 </pydev_pathproperty>
--- 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