bigboard r7390 - branches/bigboard-0-5/bigboard/stocks/people



Author: otaylor
Date: Thu Jun 19 04:01:46 2008
New Revision: 7390
URL: http://svn.gnome.org/viewvc/bigboard?rev=7390&view=rev

Log:
Make searching in the people stock much liberal for case and substrings

Modified:
   branches/bigboard-0-5/bigboard/stocks/people/PeopleStock.py

Modified: branches/bigboard-0-5/bigboard/stocks/people/PeopleStock.py
==============================================================================
--- branches/bigboard-0-5/bigboard/stocks/people/PeopleStock.py	(original)
+++ branches/bigboard-0-5/bigboard/stocks/people/PeopleStock.py	Thu Jun 19 04:01:46 2008
@@ -244,13 +244,15 @@
         return "People"
 
     def perform_search(self, query, consumer):
+        query = query.lower()
+        
         results = []
         
         for p in self.__tracker.people:
             #_logger.debug("person: " + str(p))
 
             matched = False
-            if query in p.display_name:
+            if query in p.display_name.lower():
                 matched = True
 
             for email in p.emails:
@@ -258,12 +260,15 @@
                     matched = True
                     break
                 
-            if not matched:
-                if query in p.aims:
+            for aim in p.aims:
+                if query in aim.lower():
                     matched = True
+                    break
                 
-                if query in p.xmpps:
+            for xmpp in p.xmpps:
+                if query in xmpp.lower():
                     matched = True
+                    break
 
             if matched:
                 results.append(PeopleSearchResult(self, p))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]