rtags.py
branchtls-sprint
changeset 1152 c99ef2a2535c
parent 1148 55a8238f8f7c
child 1179 70825477c6ce
equal deleted inserted replaced
1151:b20677336ee6 1152:c99ef2a2535c
       
     1 """relation tags store
       
     2 
       
     3 :organization: Logilab
       
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
       
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
       
     6 """
       
     7 __docformat__ = "restructuredtext en"
     1 
     8 
     2 class RelationTags(object):
     9 class RelationTags(object):
       
    10     """RelationTags instances are a tag store for full relation definitions :
     3 
    11 
       
    12          (subject type, relation type, object type, role)
       
    13 
       
    14     allowing to set tags using wildcard (eg '*') as subject type / object type
       
    15 
       
    16     if `use_set` is True, a set of tags is associated to each key, and you
       
    17     should use rtags / etype_rtags / add_rtag api. Otherwise, a single tag is
       
    18     associated to each key, and you should use rtag / etype_rtag / set_rtag api.
       
    19     """
       
    20     
     4     def __init__(self, use_set=False):
    21     def __init__(self, use_set=False):
     5         self.use_set = use_set
    22         self.use_set = use_set
     6         self._tagdefs = {}
    23         self._tagdefs = {}
     7         
    24         
     8     def set_rtag(self, tag, role, rtype, stype='*', otype='*'):
    25     def set_rtag(self, tag, role, rtype, stype='*', otype='*'):