[pytm-commits] tmapi/tmapi core.py,1.2,1.3 index.py,1.1,1.2
Brought to you by:
lheuer
From: Lars H. <lh...@us...> - 2005-04-22 18:54:44
|
Update of /cvsroot/pytm/tmapi/tmapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25843/tmapi Modified Files: core.py index.py Log Message: Moved some lookup methods from index to TopicMap Index: index.py =================================================================== RCS file: /cvsroot/pytm/tmapi/tmapi/index.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** index.py 18 Apr 2005 15:16:06 -0000 1.1 --- index.py 22 Apr 2005 18:54:34 -0000 1.2 *************** *** 16,20 **** # Kal Ahmed (kal at techquila.com) # Lars Marius Garshol (larsga at users.sourceforge.net) ! # Geir Ove Grønmo (grove at users.sourceforge.net) # Lars Heuer (lheuer at users.sourceforge.net) # Stefan Lischke (lischke2 at users.sourceforge.net) --- 16,20 ---- # Kal Ahmed (kal at techquila.com) # Lars Marius Garshol (larsga at users.sourceforge.net) ! # Geir Ove Grønmo (grove at users.sourceforge.net) # Lars Heuer (lheuer at users.sourceforge.net) # Stefan Lischke (lischke2 at users.sourceforge.net) *************** *** 134,154 **** ################################ ! class ITopicMapObjectsIndex(IIndex): ! """ ! An index of all TopicMapObject instances in the ! TopicMap by the value(s) of their sourceLocator property. ! """ ! def getTopicMapObjectBySourceLocator(sourceLocator): ! """ ! Returns the TopicMapObject with the specified locator ! as one of its source locators. ! ! @type loc: L{Locator<tmapi.core.Locator>} ! @param loc: the source locator of the object to be returned ! ! @rtype: L{TopicMapObject<tmapi.core.TopicMapObject>} ! @return: The TopicMapObject with the specified source locator ! or C{None} if no such object exists in the indexed TopicMap. ! """ --- 134,154 ---- ################################ ! ##class ITopicMapObjectsIndex(IIndex): ! ## """ ! ## An index of all TopicMapObject instances in the ! ## TopicMap by the value(s) of their sourceLocator property. ! ## """ ! ## def getTopicMapObjectBySourceLocator(sourceLocator): ! ## """ ! ## Returns the TopicMapObject with the specified locator ! ## as one of its source locators. ! ## ! ## @type loc: L{Locator<tmapi.core.Locator>} ! ## @param loc: the source locator of the object to be returned ! ## ! ## @rtype: L{TopicMapObject<tmapi.core.TopicMapObject>} ! ## @return: The TopicMapObject with the specified source locator ! ## or C{None} if no such object exists in the indexed TopicMap. ! ## """ *************** *** 258,285 **** """ ! def getTopicBySubjectLocator(subjectLocator): ! """ ! Retrieve the Topic in the TopicMap that has the specified ! Locator as its subject Locator. ! ! @param subjLocator: the subject locator of the Topic to retrieve ! ! @rtype: L{Topic<tmapi.core.Topic>} ! @return: a Topic instance or C{None} if no Topic has the specified ! subject locator. ! """ ! ! def getTopicBySubjectIdentifier(subjectIdentifier): ! """ ! Retrieve the Topic in the TopicMap that has the specified ! Locator as its subject indicator. ! ! @type subjIdent: L{Locator<tmapi.core.Locator>} ! @param subjIdent: the subject identifier of the Topic to retrieve. ! ! @rtype: L{Topic<tmapi.core.Topic>} ! @return: a Topic instance or C{None} if no Topic has the specified ! subject identifier. ! """ --- 258,285 ---- """ ! ## def getTopicBySubjectLocator(subjectLocator): ! ## """ ! ## Retrieve the Topic in the TopicMap that has the specified ! ## Locator as its subject Locator. ! ## ! ## @param subjLocator: the subject locator of the Topic to retrieve ! ## ! ## @rtype: L{Topic<tmapi.core.Topic>} ! ## @return: a Topic instance or C{None} if no Topic has the specified ! ## subject locator. ! ## """ ! ## ! ## def getTopicBySubjectIdentifier(subjectIdentifier): ! ## """ ! ## Retrieve the Topic in the TopicMap that has the specified ! ## Locator as its subject indicator. ! ## ! ## @type subjIdent: L{Locator<tmapi.core.Locator>} ! ## @param subjIdent: the subject identifier of the Topic to retrieve. ! ## ! ## @rtype: L{Topic<tmapi.core.Topic>} ! ## @return: a Topic instance or C{None} if no Topic has the specified ! ## subject identifier. ! ## """ Index: core.py =================================================================== RCS file: /cvsroot/pytm/tmapi/tmapi/core.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** core.py 22 Apr 2005 18:49:25 -0000 1.2 --- core.py 22 Apr 2005 18:54:34 -0000 1.3 *************** *** 623,627 **** property and the XTM 1.0 processing model is enabled. """ ! # def getReified(self): # """" --- 623,627 ---- property and the XTM 1.0 processing model is enabled. """ ! # def getReified(self): # """" *************** *** 915,918 **** --- 915,957 ---- TopicMap instance. """ + + def getObjectBySourceLocator(sourceLocator): + """ + Returns the TopicMapObject with the specified locator + as one of its source locators. + + @type loc: L{Locator<tmapi.core.Locator>} + @param loc: the source locator of the object to be returned + + @rtype: L{TopicMapObject<tmapi.core.TopicMapObject>} + @return: The TopicMapObject with the specified source locator + or C{None} if no such object exists in the TopicMap. + """ + + def getTopicBySubjectLocator(subjectLocator): + """ + Retrieve the Topic in the TopicMap that has the specified + Locator as its subject Locator. + + @param subjectLocator: the subject locator of the Topic to retrieve + + @rtype: L{Topic<tmapi.core.Topic>} + @return: a Topic instance or C{None} if no Topic has the specified + subject locator. + """ + + def getTopicBySubjectIdentifier(subjectIdentifier): + """ + Retrieve the Topic in the TopicMap that has the specified + Locator as its subject indicator. + + @type subjectIdentifier: L{Locator<tmapi.core.Locator>} + @param subjectIdentifier: the subject identifier of the Topic to retrieve. + + @rtype: L{Topic<tmapi.core.Topic>} + @return: a Topic instance or C{None} if no Topic has the specified + subject identifier. + """ + baseLocator = Attribute( |