def getByGUID(self, guid): guid = guid.upper() try: return self[self._guidIndex[guid]] except: for cid,c in self.items(): if c.guid and c.guid == guid: self._guidIndex[guid] = c.cid return c elif functions.fuzzyGuidMatch(c.guid, guid): # Found by fuzzy matching, don't index return c return None
def getByGUID(self, guid): """ Return the client matching the given GUID. :param guid: The GUID to match """ guid = guid.upper() try: return self[self._guidIndex[guid]] except Exception: for cid,c in self.items(): if c.guid and c.guid == guid: self._guidIndex[guid] = c.cid return c elif functions.fuzzyGuidMatch(c.guid, guid): # found by fuzzy matching: don't index return c return None