pytm-commits Mailing List for Python Topic Maps
Brought to you by:
lheuer
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Lars H. <lh...@us...> - 2005-05-09 19:12:53
|
Update of /cvsroot/pytm/tmapi/tmapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26947/tmapi Modified Files: core.py index.py Log Message: Removed commented out code Index: index.py =================================================================== RCS file: /cvsroot/pytm/tmapi/tmapi/index.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.py 22 Apr 2005 18:54:34 -0000 1.2 --- index.py 9 May 2005 19:12:17 -0000 1.3 *************** *** 134,156 **** ################################ - ##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. - ## """ - - class IScopedObjectsIndex(IIndex): """ --- 134,137 ---- *************** *** 258,286 **** """ - ## 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. - ## """ - class IAssociationsIndex(IIndex): --- 239,242 ---- Index: core.py =================================================================== RCS file: /cvsroot/pytm/tmapi/tmapi/core.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** core.py 22 Apr 2005 18:54:34 -0000 1.3 --- core.py 9 May 2005 19:12:16 -0000 1.4 *************** *** 83,113 **** in an underlying topic map processing system. """ - # def getTopicMap(self): - # """ - # Returns the topic map to which this object belongs. - # - # If the object is an instance of the TopicMap interface, - # then it should return itself. - # - # @rtype: L{TopicMap} - # @return: The L{TopicMap} object to which this object belongs. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getSourceLocators(self): - # """ - # Returns the set of source locators for this object. - # - # Source locators are identifiers for the object and can be - # freely assigned in order to be used to refer to the object. - # Note that on XTM import source locators MUST be assigned that - # refer to the XTM elements that gave rise to the object, - # providing the XTM element had an id attribute. - # The return value may be an empty Set, but is never C{None}. - # - # @rtype: ImmutableSet - # @return: An unmodifiable Set of L{Locator} objects - # """ - def addSourceLocator(sourceLocator): --- 83,86 ---- *************** *** 150,164 **** """ - # def getObjectId(self): - # """ - # Returns a topic map-specific identifier for this object. - # - # The identifier returned must be guaranteed to be unique across - # all TopicMapObject instances from the same TopicMap instance. - # - # @rtype: string - # @return: The system-specific identifier as a string - # """ - def __eq__(other): """ --- 123,126 ---- *************** *** 173,177 **** and self.objectId == other.objectId) or in PyProtocols notation: ! (ITopicMapObject(other, None) and self.objectId == other.objectId) """ --- 135,139 ---- and self.objectId == other.objectId) or in PyProtocols notation: ! (ITopicMapObject(other, False) and self.objectId == other.objectId) """ *************** *** 236,248 **** topic objects to define a scope or parameter property. """ - # def getScope(self): - # """ - # Returns the topics which define the scope/parameters - # - # The return value may be an empty Set, but is never C{None}. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Topic} objects - # """ def addScopingTopic(topic): --- 198,201 ---- *************** *** 305,325 **** specification. """ - # def getReference(self): - # """ - # Returns the reference string portion of the locator. - # - # @rtype: string - # @return: The address string - # """ - # raise NotImplementedError('This method must be implemented!') - # - # def getNotation(self): - # """ - # Returns the notation string of the locator. - # - # @rtype: string - # @return: The notation string - # """ - # raise NotImplementedError('This method must be implemented!') def __eq__(other): --- 258,261 ---- *************** *** 339,343 **** and self.notation == other.notation) or in PyProtocols notation: ! (ILocator(other, None) and self.reference == other.reference and self.notation == other.notation) --- 275,279 ---- and self.notation == other.notation) or in PyProtocols notation: ! (ILocator(other, False) and self.reference == other.reference and self.notation == other.notation) *************** *** 406,419 **** TMDM 5.3.6 Topic items - Properties """ - # def getTopicNames(self): - # """ - # Returns the topic names defined for this topic. - # - # Returns an unmodifiable Set of L{TopicName} objects - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{TopicName} objects - # """ - # raise NotImplementedError('This method must be implemented!') def createTopicName(value, typeOrScope, scope=None): --- 342,345 ---- *************** *** 478,502 **** """ - # def getOccurrences(self): - # """ - # Returns the occurrences defined for this topic. - # - # The return value may be an empty Set, but is never C{None}. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Occurrence} objects. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getSubjectLocators(self): - # """ - # Returns the address of the subject-constituting resource of this topic. - # - # @rtype: L{Locator} - # @return: A L{Locator} object or C{None} if no subject-constituting - # resource is defined for this Topic. - # """ - # raise NotImplementedError('This method must be implemented!') - def addSubjectLocator(subjectLocator): """ --- 404,407 ---- *************** *** 525,536 **** """ - # def getSubjectIdentifiers(self): - # """ - # Returns the addresses of the subject-indicating resources of this topic. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Locator} objects. - # """ - # raise NotImplementedError('This method must be implemented!') def addSubjectIdentifier(subjectIdentifier): --- 430,433 ---- *************** *** 556,567 **** raise NotImplementedError('This method must be implemented!') - # def getTypes(self): - # """ - # Returns the topics which define the types of this topic. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Topic} objects - # """ - # raise NotImplementedError('This method must be implemented!') def addType(topic): --- 453,456 ---- *************** *** 581,593 **** """ - # def getRolesPlayed(self): - # """ - # Returns the association roles in which this Topic is a player. - # - # @rtype: ImmutableSet - # @return: ImmutableSet of L{AssociationRole} objects (may be empty, but never C{None} - # """ - # raise NotImplementedError('This method must be implemented!') - def remove(self): """ --- 470,473 ---- *************** *** 624,637 **** """ - # def getReified(self): - # """" - # Returns a tuple of L{TopicMapObject}s which are subject to this topic. - # - # The returned Set may be empty but never C{None} - # - # @rtype: ImmutableSet - # @return: L{TopicMapObject} instances which are subject of this topic - # """ - # raise NotImplementedError('This method must be implemented!') def addSourceLocator(sourceLocator): --- 504,507 ---- *************** *** 735,768 **** TMDM 5.2 The topic map item """ - # def getTopicMapSystem(self): - # """ - # Returns the TopicMapSystem to which this topic map belongs. - # - # @rtype: L{TopicMapSystem} - # @return: The TopicMapSystem object which manages this TopicMap. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getBaseLocator(self): - # """ - # Returns the base locator of this topic map. - # - # This locator is used as the unique identifier for the TopicMap within the - # TopicMap system. It is also used for resolving references - # to resources external to the TopicMap during parsing. - # - # @rtype: L{Locator} - # @return: Locator instance - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getAssociations(self): - # """ - # Returns all of the associations in the topic map. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Association} objects. - # """ - # raise NotImplementedError('This method must be implemented!') def createAssociation(): --- 605,608 ---- *************** *** 777,789 **** """ - # def getTopics(self): - # """ - # Returns all of the topics in the topic map. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Topic} objects. - # """ - # raise NotImplementedError('This method must be implemented!') - def createTopic(): """ --- 617,620 ---- *************** *** 819,831 **** """ - # def getReifier(self): - # """ - # Returns the Topic that reifies this topic map. - # - # @rtype: L{Topic} - # @return: A Topic instance or C{None} if the topic map is not reified. - # """ - # raise NotImplementedError('This method must be implemented!') - def remove(): """ --- 650,653 ---- *************** *** 1015,1039 **** TMDM 5.7 Association items """ - # def setType(self, type): - # """ - # Sets the topic which defines the type of the association. - # - # Replaces any existing type. - # - # @type type: L{Topic} - # @param type: The topic specifying the new type of the association, - # or C{None} to set the association to be untyped. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getType(self): - # """ - # Returns the topic which defines the type of the association. - # - # @rtype: L{Topic} - # @return: The Topic object which defines the type of the association, - # or C{None} if the association is untyped. - # """ - # raise NotImplementedError('This method must be implemented!') def createAssociationRole(player, type_): --- 837,840 ---- *************** *** 1053,1075 **** """ - # def getAssociationRoles(self): - # """ - # Returns the L{AssociationRole} objects representing all of the roles - # in this association. - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Association} objects. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getReifier(self): - # """ - # Returns the Topic that reifies this association. - # - # @rtype: L{Topic} - # @return: A L{Topic} instance or C{None} if the association is not reified. - # """ - # raise NotImplementedError('This method must be implemented!') - def remove(): """ --- 854,857 ---- *************** *** 1117,1180 **** TMDM 5.8 Association role items """ - # def getAssociation(self): - # """ - # Returns the L{Association} to which this Member belongs. - # - # @rtype: L{Association} - # @return: Association object - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setPlayer(self, player): - # """ - # Sets the player of this association role. C{player} - # overwrites any previous value. - # - # @type player: L{Topic} - # @param player: The L{Topic} which plays this role in the association, - # or C{None} if no L{Topic} plays this role. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getPlayer(self): - # """ - # Returns the player of this association role. - # - # @rtype: L{Topic} - # @return: The L{Topic} which plays this role in the association, or C{None} - # if there is no role player. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getType(self): - # """ - # Returns the topic which defines the nature of this AssociationRole - # - # @rtype: L{Topic} - # @return: The L{Topic} object which defines the nature of this association - # role, or C{None} if there is no role-defining topic. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setType(self, type): - # """ - # Sets the topic which defines the nature of this association role. - # - # Overwrites any existing role specification. - # - # @type type: L{Topic} - # @param type: The L{Topic} which defines the nature of this association, - # or C{None} to remove any existing role-defining topic. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getReifier(self): - # """ - # Returns the Topic that reifies this association role. - # - # @rtype: L{Topic} - # @return: A Topic instance or C{None} if the association role is not reified. - # """ - # raise NotImplementedError('This method must be implemented!') def remove(): --- 899,902 ---- *************** *** 1235,1321 **** TMDM 5.6 Occurrence items """ - # def getTopic(self): - # """ - # Returns the topic to which this occurrence belongs. - # - # @rtype: L{Topic} - # @return: The Topic object which contains this Occurrence. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setType(self, type): - # """ - # Sets the topic which defines the type of this occurrence. - # - # Overwrites any existing type information. - # - # @type type: L{Topic} - # @param type: The Topic which defines the type of this Occurrence, - # or C{None} to remove any existing type. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getType(self): - # """ - # Returns the topic which defines the type of this occurrence. - # - # @rtype: L{Topic} - # @return: The Topic object which defines the type of this - # Occurrence, or C{None} if there is no occurrence type. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getValue(self): - # """ - # Returns the data string associated with this occurrence. - # - # @rtype: string - # @return: The resource data string of this occurrence, or C{None} - # if the occurrence does not have a resource data string. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setValue(self, value): - # """ - # Sets the resource data string for this occurrence. - # - # This method will overwrite any existing resource data - # string and will replace any existing resource reference. - # - # @type value: string - # @param value: The resource data string - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getResource(self): - # """ - # Returns the resource reference address associated with this occurrence. - # - # @rtype: L{Locator} - # @return: The Locator object for the resource reference, or C{None} - # if this occurrence does not have a resource reference. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setResource(self, loc): - # """ - # Sets the resource reference for this occurrence. - # - # This method will overwrite any existing resource reference and - # will set the value of the value property to C{null}. - # - # @type loc: L{Locator} - # @param loc: The resource reference - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getReifier(self): - # """ - # Returns the Topic that reifies this occurrence. - # - # @rtype: L{Topic} - # @return: A Topic instance or C{None} if the occurrence is not reified. - # """ - # raise NotImplementedError('This method must be implemented!')('This method must be implemented!') def remove(): --- 957,960 ---- *************** *** 1380,1427 **** TMDM 5.4 Topic name items """ - # def getTopic(self): - # """ - # Returns the L{Topic} which contains this topic name. - # - # @rtype: L{Topic} - # @return: The L{Topic} instance where this TopicName belongs to - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getValue(self): - # """ - # Returns the value of this TopicName - # - # @rtype: string - # @return: The value string or C{None} if this TopicName has no name string. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setValue(self, value): - # """ - # Define the name string for this TopicName. - # - # A new value will replace any existing value. - # A C{None} value indicates that there is no name string for this TopicName. - # - # @type value: string - # @param value: The string value to be assigned to this TopicName - # - # @raise MergeException: If the processor detects that a merge is required - # and either automerge is disabled or automerge is enabled but the merge - # cannot be completed for some other reason. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getVariants(self): - # """ - # Returns the variants defined for this TopicName. - # - # The returned Set may be empty, but never C{None} - # - # @rtype: ImmutableSet - # @return: An ImmutableSet of L{Variant} objects. - # """ - # raise NotImplementedError('This method must be implemented!') def createVariant(valueOrResource, scope): --- 1019,1022 ---- *************** *** 1443,1491 **** """ - # def getReifier(self): - # """ - # Returns the Topic that reifies this topic name. - # - # @rtype: L{Topic} - # @return: A L{Topic} instance or C{None} if the topic name is not reified - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getType(self): - # """ - # Returns the L{Topic} that defines the type of this base name. - # - # @attention: Optional! This method reflects the XTM 1.1 model. - # A processor which does not implement support for XTM 1.1 - # MUST return C{None}. - # - # @rtype: L{Topic} - # @return: A L{Topic} instance or C{None} if the topic name does not - # have a type specified. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setType(self, type): - # """ - # Sets the topic which defines the type of the TopicName. - # - # Replaces any existing type. - # - # @attention: Optional! This method reflects the XTM 1.1 model. - # A processor which does not implement support for XTM 1.1 - # MUST throw an C{UnsupportedOperationException}. - # - # @type type: L{Topic} - # @param type: The topic specifying the new type of the association, - # or C{None} to set the association to be untyped - # - # @raise UnsupportedOperationException: If the processor - # does not support the XTM 1.1 model. - # @raise MergeException: If the processor detects that a merge is required - # and either automerge is disabled or automerge is enabled but - # the merge cannot be completed for some other reason. - # """ - # raise NotImplementedError('This method must be implemented!') - def remove(self): """ --- 1038,1041 ---- *************** *** 1593,1657 **** TMDM 5.5 Variant items """ - # def getTopicName(self): - # """ - # Returns the topic name to which this variant belongs. - # - # @rtype: L{TopicName} - # @return: The L{TopicName} object where this Variant belongs to - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getValue(self): - # """ - # Returns the data string associated with this variant. - # - # @rtype: string - # @return: The resource data string of this Variant, or C{None} - # if the variant does not have a resource data string. - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setValue(self, value): - # """ - # Sets the resource data string for this variant. - # - # This method will overwrite any existing resource data - # string and will replace any existing resource reference. - # - # @type value: string - # @param value: string value - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getResource(self): - # """ - # Returns the resource reference address associated with this variant. - # - # @rtype: L{Locator} - # @return: The Locator object for the resource reference, or C{None} - # if this variant does not have a resource reference - # """ - # raise NotImplementedError('This method must be implemented!') - - # def setResource(self, loc): - # """ - # Sets the resource reference for this variant. - # - # This method will overwrite any existing - # resource reference and will replace any existing resource data. - # - # @type loc: L{Locator} - # @param loc: A L{Locator} object which represents the resource reference - # """ - # raise NotImplementedError('This method must be implemented!') - - # def getReifier(self): - # """ - # Returns the L{Topic} that reifies this variant name. - # - # @rtype: L{Topic} - # @return: A Topic instance or C{None} if the variant name is not reified. - # """ - # raise NotImplementedError('This method must be implemented!') def remove(self): --- 1143,1146 ---- *************** *** 1764,1779 **** """ - # def getBaseLocators(self): - # """ - # Returns the base locators of the topic maps managed by the system. - # - # The return value may be an empty Set if no TopicMaps are loaded - # in the TopicMapSystem, but must never be <code>None</code>. - # - # @rtype: ImmutableSet - # @return: An unmodifiable Set of base locator objects - # """ - # raise NotImplementedError('This method must be implemented!') - def close(): """ --- 1253,1256 ---- |
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( |
From: Lars H. <lh...@us...> - 2005-04-22 18:49:36
|
Update of /cvsroot/pytm/tmapi/tmapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22219/tmapi Modified Files: core.py Log Message: Fixed a PyProtocols bug, renamed Association.[associationRoles] to .[roles] Index: core.py =================================================================== RCS file: /cvsroot/pytm/tmapi/tmapi/core.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** core.py 18 Apr 2005 15:16:06 -0000 1.1 --- core.py 22 Apr 2005 18:49:25 -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) *************** *** 1043,1047 **** """ ! associationRoles = Attribute( """ Returns the AssociationRole objects representing all of the roles --- 1043,1047 ---- """ ! roles = Attribute( """ Returns the AssociationRole objects representing all of the roles *************** *** 1929,1932 **** NO_ADAPTER_NEEDED, provides = [ITypedObject], ! forTypes = [IAssociation, IAssociationRole, IOccurrence, ITopicName] ) --- 1929,1932 ---- NO_ADAPTER_NEEDED, provides = [ITypedObject], ! forProtocols = [IAssociation, IAssociationRole, IOccurrence, ITopicName] ) |
From: Lars H. <lh...@us...> - 2005-04-18 15:16:20
|
Update of /cvsroot/pytm/tmapi/tmapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1085/tmapi Added Files: __init__.py _exceptions.py core.py index.py Log Message: Initial import of Python TMAPI interfaces --- NEW FILE: index.py --- # -*- coding: UTF-8 -*- # TMAPI 1.0 # # Version 1.0 of the Topic Maps API (TMAPI), created collectively by # the membership of the tmapi-discuss mailing list # (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), # is hereby released into the public domain. # # No one owns TMAPI: you may use it freely in both commercial and # non-commercial applications, bundle it with your software # distribution, include it on a CD-ROM, list the source code in a # book, mirror the documentation at your own web site, or use it in # any other way you see fit. # # 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) # Graham Moore (gra_moore at users.sourceforge.net) # # 08 April 2004 # Note: # This Python interfaces / classes are not 100% TMAPI compatible and # the documentation may differ from the TMAPI Java interface. # Only the Java interfaces and documentation are normative. """ This module contains the index interfaces of TMAPI. @version: 1.0 @author: Lars Heuer (heuer[at]semagia.com) @copyright: Members of TMAPI.org - http://www.tmapi.org/ @licence: TMAPI Licence http://www.tmapi.org/LICENCE.txt Id: $Revision: 1.1 $ """ try: from protocols import Interface except ImportError: from warnings import warn warn('PyProtocols is not installed.') class Interface: pass import tmapi.core from tmapi._exceptions import TMAPIIndexException __all__ = ['IIndexFlags', 'IIndex', 'ITopicMapObjectsIndex', 'IScopedObjectsIndex', 'ITopicsIndex', 'IAssociationsIndex', 'IAssociationRolesIndex', 'IOccurrencesIndex', 'IVariantsIndex', 'TMAPIIndexException'] class IIndexFlags(Interface): """ Interface representing static index meta data. """ def isAutoUpdated(self): """ Returns the auto-update flag for the index. If the value of this flag is C{True}, then the index is automatically kept synchronized with the TopicMap as values are changed. If the value is C{False}, then the {Index#reindex()} method must be called to resynchronize the Index with the TopicMap after values are changed. @rtype: boolean @return: the auto-update flag value. """ ############################### # TMAPI Index Base Interface ############################### class IIndex(tmapi.core.ITopicMapSystem.ConfigurableHelperObject): """ Abstract representation of a topic map index. This is the base interface that must be implemented by all indexes. """ def open(): """ Open the index. This method must be invoked before using any other method exported by this interface or derived interfaces. @raise TMAPIIndexException: If a failure occurrs. """ def close(): """ Close the index. @raise TMAPIIndexException: If a failure occurrs. """ def isOpen(): """ Return the state of this Index. @rtype: boolean @return: C{True} if the Index is currently open, C{False} otherwise. @raise TMAPIIndexException: If a failure occurrs. """ def reindex(): """ Resynchronize this Index with the data in the TopicMap @raise TMAPIIndexException: If a failure occurrs. """ def getFlags(): """ Retrieve the IndexFlag instance that represents the static meta data for this Index. @return: the IndexFlag instance that represents the static meta data for this Index. @raise TMAPIIndexException: If a failure occurrs. """ ################################ # TMAPI Index Core Interfaces ################################ 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. """ class IScopedObjectsIndex(IIndex): """ An index of all ScopedObject (Association, TopicName, Occurrence and Variant) instances in the indexed TopicMap. This index provides methods to retrieve all of the ScopedObject instances in the TopicMap with a particular Topic or set of Topics in their scope, and to retrieve all of the Topics used in the scope of one or more ScopedObjects in the TopicMap. """ def getScopingTopics(): """ Returns all Topic instances which are present in the scope of one or more ScopedObject instances in the indexed TopicMap. The return value may be an empty Collection but must never be C{None}. @return: an unmodifiable Collection of Topic instances. """ def getScopedObjectsByScopingTopic(scopingTopic): """ Returns all ScopedObject instances where the specified Topic is one of the themes in the scope of the ScopedObject. The return value may be an empty Collection but must never be C{None}. @type scopingTopic: L{Topic<tmapi.core.Topic>} @param scopingTopic: the Topic that must be in the scope of each returned L{ScopedObject<tmapi.core.ScopedObject>}. @return: an unmodifiable Collection of ScopedObject instances. """ def getScopedObjectsByScopingTopics(scopingTopics, matchAll): """ Returns all ScopedObject instances where some or all of the specified Topics are in the scope of the ScopedObject. The return value may be an empty Collection but must never be C{None}. @type scopingTopics: tuple, list, set @param scopingTopics: the Topics which must be in the scope of each returned ScopedObject instance. @type matchAll: boolean @param matchAll: if C{True}, then only those L{ScopedObject<tmapi.core.IScopedObject>}s where all of the Topics in C{scopingTopics} are present in the scope will be returned, otherwse all L{ScopedObject<tmapi.core.ScopedObject>}s where one or more of the Topics specfified in C{scopingTopics} will be returned. """ class ITopicsIndex(IIndex): """ An index of the Topics in the TopicMap. This index provides methods to retrieve all of the Topics in the TopicMap which are used to define the type of one or more Topics in the TopicMap. The index also provides methods to retrieve all Topics with one or more types and to retrieve Topics by their reified subject address or subject indicators. """ def getTopicTypes(): """ Retrieve the Topics that are used as topic types in the indexed TopicMap. The return value may be an empty Collection but must never be C{None}. @return: a Collection of Topic instances. """ def getTopicsByType(topic): """ Retrieve the Topics in the TopicMap that include the Topic C{type} as one of their types. The return value may be an empty Collection but must never be C{None}. @param topic: the type of the Topics to be returned @return: a Collection of Topic instances. """ def getTopicsByTypes(topics, matchAll): """ Retrieve the Topics in the TopicMap that include all of the specified topics amongst their types. The return value may be an empty Collection but must never be C{None}. @type topics: list, tuple, set @param topics: the types of the Topics to be returned @type matchAll: boolean @param matchAll: If C{True}, then only those Topic instances where all of the Topics in types are present as type property will be returned (this includes the superset of the given Topics in the C{topics} argument), otherwise all Topics where one ore more of the Topics specified in C{types} are present as type property will be returned. @return: a Collection of Topic instances. """ 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. """ class IAssociationsIndex(IIndex): """ An index of Association instances in a TopicMap. This index provides an index of Associations by their type and a method for retrieving all Topics which are used to specify the type of one or more Associations. """ def getAssociationTypes(): """ Retrieve the Topics which are used to type Associations in this TopicMap. The return value may be an empty Collection but must never be C{None}. @return: A Collection of Topic instances. """ def getAssociationsByType(topic): """ Retrieve the Associations which are typed by the Topic C{type}. The return value may be an empty Collection but must never be C{None}. @type topic: L{Topic<tmapi.core.Topic>} @param topic: The type of Associations to be returned @return: a Collection of Association instances. """ class IAssociationRolesIndex(IIndex): """ An index of the AssociationRole in the indexed TopicMap. This index provides methods to retrieve AssociationRole instances by their type and to retrieve the collection of all Topics which define the type of one or more AssociationRole instances in the indexed TopicMap. """ def getAssociationRoleTypes(): """ Returns all Topic instances used to type AssociationRole instances in the indexed TopicMap The return value may be an empty Collection but must never be C{None}. @return: A Collection of Topic instances. """ def getAssociationRolesByType(topic): """ Returns all AssociationRole instances typed by the Topic C{type} in the indexed Topic Map The return value may be an empty Collection but must never be C{None}. @type topic: L{Topic<tmapi.core.Topic>} @param topic: The type of the AssociationRole instances to be returned. @return: a Collection of AssociationRole instances. """ class IOccurrencesIndex(IIndex): """ An index of all Occurrence instances in the TopicMap by their type and resource or value. """ def getOccurrenceTypes(): """ Returns the Topics which are used to type Occurrences in the indexed TopicMap. The return value may be an empty Collection but must never be C{None}. @return: a Collection of Topic instances """ def getOccurrencesByType(topic): """ Returns the Occurrences typed by the topic C{type}. The return value may be an empty Collection but must never be C{None}. @type topic: L{Topic<tmapi.core.Topic>} @param topic: The type of Occurrences to be returned @return: A Collection of Occurrence instances. """ def getOccurrencesByResource(resource): """ Returns the Occurrences in the topic map whose resource locator matches C{resource}. The return value may be an empty Collection but must never be C{None}. @type resource: L{Locator<tmapi.core.Locator>} @param resource: The L{Locator<tmapi.core.Locator>} used to query the index @rtype: Tuple @return: A Collection of Occurrence instances. """ def getOccurrencesByValue(value): """ Returns the Occurrences in the topic map whose value property matches C{value}. The return value may be an empty Collection but must never be C{None}. @type value: string @param value: The data string used to query the index @return: a Collection of Occurrence instances. """ class ITopicNamesIndex(IIndex): """ This Index gives direct access to all TopicNames. you can get all TopicNames, or a TopicName by value. """ def getTopicNamesByValue(value): """ Retrieves the TopicNames in the TopicMap which have a value equal to C{value} The return value may be an empty Collection but must never be C{None}. @param value: Value of the TopicNames to be returned @return: a Collection of TopicName instances. """ def getTopicNameTypes(): """ Retrieves the topics in the TopicMap which define the type of one or more TopicNames. The return value may be an empty Collection but must never be C{None}. @return: a Collection of Topic instances. """ def getTopicNamesByType(topic): """ Retrieves the TopicNames in the indexed TopicMap whose type is defined by the specified Topic. The return value may be an empty Collection but must never be C{None}. @type topic: L{Topic<tmapi.core.Topic>} @param topic: the type of the TopicNames to be retrieved. @return: a Collection of TopicNames instances. """ class IVariantsIndex(IIndex): """ An index of all Occurrence instances in the TopicMap by their type and resource or value. """ def getVariantsByResource(resource): """ Returns the Variants in the topic map whose resource locator matches C{resource}. The return value may be an empty Collection but must never be C{None}. @type resource: L{Locator<tmapi.core.Locator>} @param resource: The L{Locator<tmapi.core.Locator>} used to query the index @rtype: Tuple @return: A Collection of Variant instances. """ def getVariantsByValue(value): """ Returns the Variants in the topic map whose value property matches C{value} The return value may be an empty Collection but must never be C{None}. @type value: string @param value: The data string used to query the index @return: a Collection of Variant instances. """ --- NEW FILE: __init__.py --- # -*- coding: UTF-8 -*- # TMAPI 1.0 # # Version 1.0 of the Topic Maps API (TMAPI), created collectively by # the membership of the tmapi-discuss mailing list # (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), # is hereby released into the public domain. # # No one owns TMAPI: you may use it freely in both commercial and # non-commercial applications, bundle it with your software # distribution, include it on a CD-ROM, list the source code in a # book, mirror the documentation at your own web site, or use it in # any other way you see fit. # # 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) # Graham Moore (gra_moore at users.sourceforge.net) # # 08 April 2004 # Note: # This Python interfaces / classes are not 100% TMAPI compatible and # the documentation may differ from the TMAPI Java interface. # Only the Java interfaces and documentation are normative. """ This package contains the Python TMAPI classes. It depends on the "PyProtocols" package located at (U{http://peak.telecommunity.com/}) by Phillip J. Eby. @version: 1.0 @author: Lars Heuer (heuer[at]semagia.com) @copyright: Members of TMAPI.org - http://www.tmapi.org/ @licence: TMAPI Licence http://www.tmapi.org/LICENCE.txt """ __all__ = ['core', 'index'] --- NEW FILE: _exceptions.py --- # -*- coding: UTF-8 -*- # TMAPI 1.0 # # Version 1.0 of the Topic Maps API (TMAPI), created collectively by # the membership of the tmapi-discuss mailing list # (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), # is hereby released into the public domain. # # No one owns TMAPI: you may use it freely in both commercial and # non-commercial applications, bundle it with your software # distribution, include it on a CD-ROM, list the source code in a # book, mirror the documentation at your own web site, or use it in # any other way you see fit. # # 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) # Graham Moore (gra_moore at users.sourceforge.net) # # 08 April 2004 # Note: # This Python interfaces / classes are not 100% TMAPI compatible and # the documentation may differ from the TMAPI Java interface. # Only the Java interfaces and documentation are normative. """ This module contains all TMAPI Exceptions for the core and the index classes. @version: 1.0 @author: Lars Heuer (heuer[at]semagia.com) @copyright: Members of TMAPI.org - http://www.tmapi.org/ @licence: TMAPI Licence http://www.tmapi.org/LICENCE.txt Id: $Revision: 1.1 $ """ import exceptions class TMAPIException(exceptions.Exception): """ The base class for all standard (non run-time) exceptions thrown by a TMAPI system. """ def __init__(self, msg, exception=None): """ @type msg: C{string} @param msg: The detail message. This message is saved for later retrieval by the L{getMessage()} method. @type exception: C{Exception} @param exception: An exception which is the cause for this exception, or C{None} (default) """ self._msg = msg self._exception = exception def getMessage(self): """ Returns the message for this exception. @rtype: string @return: The message of this exception """ return self._msg def getCause(self): """ Returns the exception or C{None} if there is none. @rtype: C{Exception} @return: The exception or C{None} if there is none """ return self._exception def __str__(self): """ Returns the string representation / the message """ return self._msg class TMAPIRuntimeException(exceptions.RuntimeError): """ Instances of this exception class should be thrown in cases where there is an error in the underlying topic map processing system or when integrity constraints are violated by a remove() operation. """ def __init__(self, msg, exception=None): """ @type msg: C{string} @param msg: The detail message. This message is saved for later retrieval by the L{getMessage()} method. @type exception: C{Exception} @param exception: An exception which is the cause for this exception, or C{None} (default) """ self._msg = msg self._exception = exception def getMessage(self): """ Returns the message for this exception. @rtype: string @return: The message of this exception """ return self._msg def getCause(self): """ Returns the exception or C{None} if there is none. @rtype: Exception @return: The exception or C{None} if there is none """ return self._exception def __str__(self): """ Returns the string representation / the message """ return self._msg class MergeException(TMAPIRuntimeException): """ The base class for exceptions related to merging of Topic or TopicMap instances. Applications should not raise an instance of this exception class, but should instead raise an instance of one of the derived classes. In TMAPI 1.0, two subclasses of this exception are defiend. The L{TopicsMustMergeException} is only ever thrown by a processor with the automerge feature disabled. This exception indicates that a merge of two topics is required to maintain consistency with the standard Topic Maps Data Model. The L{SubjectLocatorClashException} is only ever thrown by a processor with the automerge feature enabled and with the XTM 1.0 model enabled. This exception indicates that the processor attempted to perform the merger of two Topics as required for consistency with the Topic Maps Data Model, but found that the merge could not be completed due to the XTM 1.0 constraint that a Topic can only have a single sourceLocator property value. """ pass class TopicsMustMergeException(MergeException): """ Exception raised when a Topic is changed in such a way that it would have to be merged with another Topic in the same TopicMap. This exception should only be thrown if the "Automatic Merging" feature U{http://tmapi.org/features/automerge/} is disabled. If automatic merging is enabled, then the merge should take place transparently to the API user. If an implementation throws this exception, then the property change which caused the exception to be raised MUST NOT be completed. """ def __init__(self, modified, unmodified, msg): """ Creates a new TopicMustMergeException with the specified message. @type modified: C{Topic} @param modified: The Topic which was modified by the operation that raised this exception. @type unmodified: C{Topic} @param unmodified: Topic which was not modified by the operation that raised this exception. @type msg: C{string} @param msg: The message for this exception. """ MergeException.__init__(self, msg) self._modified = modified self._unmodified = unmodified def getModifiedTopic(self): """ Returns the Topic which was changed in the operation that raised this exception. @rtype: C{Topic} @return: A Topic instance """ return self._modified def getUnmodifiedTopic(self): """ Returns the Topic which was unchanged in the operation that raised this exception. @rtype: C{Topic} @return: A Topic instance """ return self._unmodified class SubjectLocatorClashException(MergeException): """ Thrown when two topics cannot be merged because the XTM 1.0 model does not allow a Topic to have more than one value for the sourceLocators property. This exception can only ever be thrown by a processor with the XTM 1.0 model feature enabled. If the automerge feature is disabled, then this exception can only ever be thrown by the methods L{Topic#mergeIn(Topic)} and L{TopicMap#mergeIn(TopicMap)}. The exception indicates that the processor attempted to perform the merger of two Topics as required for consistency with the Topic Maps Data Model, but found that the merge could not be completed due to the XTM 1.0 constraint that a Topic can only have a single subjectLocator property value. The attempted merge reported by this exception MUST NOT be completed by the processor. """ def __init__(self, topics, msg): """ Constructs a new exception instance that reports a subject locator clash when merging topics. @type topics: iterateable of C{topics} @param topics: The topics involved in the clash. @type msg: C{string} @param msg: A message string describing the exception """ MergeException.__init__(self, msg) self._topics = topics def getTopics(self): """ Returns the topics involved in the clash of subjectLocator property values. @rtype: C{Topic} @return: Topic instances. """ return self._topics class ModelConstraintException(TMAPIRuntimeException): """ Exception thrown when an attempt is made to modify a TopicMapObject in a way which violates a constraint of the currently enabled processor model. Currently, this exception is only thrown by the method L{Topic#addSubjectLocator} when the XTM 1.0 processing model is enabled and the topic already has one subjectLocator. """ def __init__(self, modified, msg): """ Creates a ModelConstraintExcpetion with given object and message. @type modified: C{Topic} @param modified: The modified topicmapobject (currently only a Topic instance is allowed. @type msg: C{string} @param msg: A message for this exception. """ TMAPIRuntimeException.__init__(self, msg) self._modified = modified def getModifiedObject(self): """ Returns the modified object (currently only Topic instance) rtype: C{Topic} return: A Topic instance. """ return self._modified class UnsupportedOperationException(TMAPIRuntimeException): """ Exception raised if a processor does not support an operation. (i.e. trying to use a XTM 1.1 feature, while proc. only supports XTM 1.0) """ pass class TopicInUseException(TMAPIException): """ Thrown when an attempt is made to remove a Topic which is being used as a type, as a role, as a role player in an association, or in a scope. """ pass class DuplicateSourceLocatorException(TMAPIRuntimeException): """ Exception is raised when a source locator is added to a TopicMapObject, that already exists in this TopicMap. It is not thrown when both TopicMapObjects are instance of Topic. In this case a TopicsMustMerge Exception is thrown only in TMAPI implementations, that do not support the "Automatic Merging" feature U{http://tmapi.org/features/automerge/}. If the implementation does support automatic merging, then the merge should take place transparently to the API user. """ def __init__(self, modified, unmodified, sourceLocator, msg=''): """ Creates a new DuplicateSourceLocatorException with the specified message. @type modified: C{TopicMapObject} @param modified: The TopicMapObject to which the source locator is given @type unmodified: C{TopicMapObject} @param unmodified: The TopicMapObject which already had this source locator @type sourceLocator: Locator @param sourceLocator: The source locator which has been duplicated. """ TMAPIRuntimeException.__init__(self, msg) self._modified = modified self._unmodified = unmodified self._sourceLocator = sourceLocator def getModifiedTopicMapObject(self): """ Returns the TopicMapObject, which already had the duplicated source locator. @rtype: C{TopicMapObject} @return: A TopicMapObject instance """ return self._modified def getUnmodifiedTopicMapObject(self): """ Returns the TopicMapObject to which the duplicate source locator was given. @rtype: C{TopicMapObject} @return: A TopicMapObject instance """ return self._unmodified def getSourceLocator(self): """ Returns the duplicate source locator. @rtype: C{Locator} @return: A Locator instance """ return self._sourceLocator ############################################ # TMAPI TopicMapSystem Exception classes ############################################ class TopicMapExistsException(TMAPIException): """ Exception thrown when an attempt is made to create a new TopicMap with a base locator that is already assigned to another TopicMap in the same TopicMapSystem. """ pass class UnsupportedHelperObjectException(TMAPIException): """ Exception raised when no implementation class is specified for a requested helper object interface. """ pass class HelperObjectConfigurationException(TMAPIException): """ Exception raised when the configuration of a L{ConfigurableHelperObject} instance fails. """ pass class HelperObjectInstantiationException(TMAPIException): """ Exception raised when the instantiation of a helper object fails. """ pass ##################################### # TMAPI Factory Exception classes ##################################### class FactoryConfigurationException(TMAPIException): """ Exception thrown when a TopicMapSystemFactory instance cannot be instantiated through the method TopicMapSystemFactory#newInstance(). """ pass class FeatureNotRecognizedException(FactoryConfigurationException): """ Exception thrown when the TopicMapSystemFactory does not recognize the name of a feature that the application is trying to enable or disable. """ pass class FeatureNotSupportedException(FactoryConfigurationException): """ Exception thrown when the underlying implementation cannot support enabling or disabling a recognised feature. If the feature name is not recognised, implementations B{MUST} throw a FeatureNotRecognizedException rather than a FeatureNotSupportedException. """ pass ########################### # TMAPI Index Exception ########################### class TMAPIIndexException(TMAPIException): """ Class of exceptions raised by index access and update methods. """ pass --- NEW FILE: core.py --- # -*- coding: UTF-8 -*- # TMAPI 1.0 # # Version 1.0 of the Topic Maps API (TMAPI), created collectively by # the membership of the tmapi-discuss mailing list # (http://lists.sourceforge.net/mailman/listinfo/tmapi-discuss), # is hereby released into the public domain. # # No one owns TMAPI: you may use it freely in both commercial and # non-commercial applications, bundle it with your software # distribution, include it on a CD-ROM, list the source code in a # book, mirror the documentation at your own web site, or use it in # any other way you see fit. # # 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) [...1893 lines suppressed...] @param value: the value to be set of this property or C{None} to remove the property from the current factory configuration. """ raise NotImplementedError('This method must be implemented!') def setProperties(self, props): """ @see: L{TopicMapSystemFactory.setProperty(property, value)<setProperty(self, property, value)>} @type props: C{dict} @param props: A dictionary of key:value pairs """ raise NotImplementedError('This method must be implemented!') declareAdapter( NO_ADAPTER_NEEDED, provides = [ITypedObject], forTypes = [IAssociation, IAssociationRole, IOccurrence, ITopicName] ) |
From: Lars H. <lh...@us...> - 2005-04-18 15:14:34
|
Update of /cvsroot/pytm/tmapi/tmapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32084/tmapi Log Message: Directory /cvsroot/pytm/tmapi/tmapi added to the repository |
From: Lars H. <lh...@us...> - 2005-03-30 13:41:43
|
Update of /cvsroot/pytm/CVSROOT In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20239 Modified Files: loginfo Log Message: Index: loginfo =================================================================== RCS file: /cvsroot/pytm/CVSROOT/loginfo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** loginfo 30 Mar 2005 12:10:47 -0000 1.2 --- loginfo 30 Mar 2005 13:41:04 -0000 1.3 *************** *** 27,30 **** #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog # ! # Send commit msgs to the tmapi-utils-commits list - LH 30.03.2005 DEFAULT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} pyt...@li... \ No newline at end of file --- 27,30 ---- #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog # ! # Send commit msgs to the pytm-commits list - LH 30.03.2005 DEFAULT /cvsroot/sitedocs/CVSROOT/cvstools/syncmail %{sVv} pyt...@li... \ No newline at end of file |
From: Lars H. <lh...@us...> - 2005-03-30 12:15:45
|
Update of /cvsroot/pytm/sandbox/lars In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10367/lars Log Message: Directory /cvsroot/pytm/sandbox/lars added to the repository |