rtags.py
branchtls-sprint
changeset 1748 aa1806e76699
parent 1744 056ed8fca8d3
child 1752 4b0b912ff5b7
equal deleted inserted replaced
1747:d48613e65196 1748:aa1806e76699
    48                 keys.remove((rtype, tagged, stype, '*'))
    48                 keys.remove((rtype, tagged, stype, '*'))
    49         return keys
    49         return keys
    50 
    50 
    51     def init(self, schema):
    51     def init(self, schema):
    52         # XXX check existing keys against schema
    52         # XXX check existing keys against schema
    53         for rtype, tagged, stype, otype in self._tagdefs.keys():
    53         for (rtype, tagged, stype, otype), value in self._tagdefs.items():
    54             for ertype in (stype, rtype, otype):
    54             for ertype in (stype, rtype, otype):
    55                 if ertype != '*' and not ertype in schema:
    55                 if ertype != '*' and not ertype in schema:
    56                     self.warning('removing rtag for %s, undefined in schema',
    56                     self.warning('removing rtag %s: %s, %s undefined in schema',
    57                                  ertype)
    57                                  (stype, rtype, otype, tagged), value, ertype)
    58                     self.del_rtag(stype, rtype, otype, tagged)
    58                     self.del_rtag(stype, rtype, otype, tagged)
    59         if self._initfunc is not None:
    59         if self._initfunc is not None:
    60             for eschema in schema.entities():
    60             for eschema in schema.entities():
    61                 for rschema, tschemas, role in eschema.relation_definitions(True):
    61                 for rschema, tschemas, role in eschema.relation_definitions(True):
    62                     for tschema in tschemas:
    62                     for tschema in tschemas: