def __getitem__(self, guid): guid = guid_bracket(guid) for o in self.objects: if o.guid == guid or knownguids.get(o.guid,[None])[0] == guid: return o else: raise KeyError('No guid ' + guid)
def __getitem__(self, guid): guid = guid_bracket(guid) for o in self.objects: if o.guid == guid or knownguids.get(o.guid, [None])[0] == guid: return o else: raise KeyError('No guid ' + guid)
def guid_to_known(self, guid): guid = guid_bracket(guid) v = knownguids.get(guid) if v: return v[0] default = self.default if default and guid == default.guid: return '{default}' else: return guid