[pypy-svn] r7644 - pypy/trunk/src/pypy/translator/tool/pygame

mgedmin at codespeak.net mgedmin at codespeak.net
Tue Nov 23 19:02:11 CET 2004


Author: mgedmin
Date: Tue Nov 23 19:02:07 2004
New Revision: 7644

Modified:
   pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py
Log:
Show how many items were found.



Modified: pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py
==============================================================================
--- pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py	(original)
+++ pypy/trunk/src/pypy/translator/tool/pygame/graphdisplay.py	Tue Nov 23 19:02:07 2004
@@ -290,7 +290,7 @@
             self.setstatusbar('Not found: %s' % self.searchstr)
             return
         self.searchpos += 1
-        self.highlight_found_item(self.searchresults[self.searchpos])
+        self.highlight_found_item()
 
     def find_prev(self):
         if not self.searchstr:
@@ -299,19 +299,22 @@
             self.setstatusbar('Not found: %s' % self.searchstr)
             return
         self.searchpos -= 1
-        self.highlight_found_item(self.searchresults[self.searchpos])
+        self.highlight_found_item()
 
-    def highlight_found_item(self, item):
+    def highlight_found_item(self):
+        item = self.searchresults[self.searchpos]
         self.sethighlight(obj=item)
+        msg = 'Found %%s containing %s (%d/%d)' % (self.searchstr,
+                        self.searchpos+1, len(self.searchresults))
         if isinstance(item, Node):
-            self.setstatusbar('Found node containing %s' % self.searchstr)
+            self.setstatusbar(msg % 'node')
             self.look_at_node(item, keep_highlight=True)
         elif isinstance(item, Edge):
-            self.setstatusbar('Found edge containing %s' % self.searchstr)
+            self.setstatusbar(msg % 'edge')
             self.look_at_edge(item, keep_highlight=True)
         else:
             # should never happen
-            self.setstatusbar('Found %r containing %s' % (item, self.searchstr))
+            self.setstatusbar(msg % item)
 
     def setlayout(self, layout):
         if self.viewer:



More information about the Pypy-commit mailing list