Quellcode durchsuchen

moved doFind* to ConnectionRepository so they are available on AI

Darren Ranalli vor 22 Jahren
Ursprung
Commit
28e1196c5f
1 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen
  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.notify.info('*** RESTORING SIMULATED PULLED-NETWORK-PLUG ***')
             self.tcpConn = self.hijackedTcpConn
             self.tcpConn = self.hijackedTcpConn
             del 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