Browse Source

moved doFind* to ConnectionRepository so they are available on AI

Darren Ranalli 22 years ago
parent
commit
28e1196c5f
1 changed files with 14 additions and 0 deletions
  1. 14 0
      direct/src/distributed/ConnectionRepository.py

+ 14 - 0
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