From 28e1196c5faecc73c44b5c69bf230c07bf946cfb Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Sat, 6 Sep 2003 03:24:18 +0000 Subject: [PATCH] moved doFind* to ConnectionRepository so they are available on AI --- direct/src/distributed/ConnectionRepository.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/direct/src/distributed/ConnectionRepository.py b/direct/src/distributed/ConnectionRepository.py index a36d49b154..edb9611236 100644 --- a/direct/src/distributed/ConnectionRepository.py +++ b/direct/src/distributed/ConnectionRepository.py @@ -317,3 +317,17 @@ class ConnectionRepository(DirectObject.DirectObject): self.notify.info('*** RESTORING SIMULATED PULLED-NETWORK-PLUG ***') self.tcpConn = self.hijackedTcpConn del self.hijackedTcpConn + + def doFind(self, str): + """ returns list of distributed objects with matching str in value """ + for value in self.doId2do.values(): + if `value`.find(str) >= 0: + return value + + def doFindAll(self, str): + """ returns list of distributed objects with matching str in value """ + matches = [] + for value in self.doId2do.values(): + if `value`.find(str) >= 0: + matches.append(value) + return matches