[Pywikipedia-l] SVN: [4727] trunk/pywikipedia/replace.py

rotem at svn.wikimedia.org rotem at svn.wikimedia.org
Mon Dec 17 20:27:16 UTC 2007


Revision: 4727
Author:   rotem
Date:     2007-12-17 20:27:11 +0000 (Mon, 17 Dec 2007)

Log Message:
-----------
Reverting part of r4557: self.exceptions seems to have both strings and regexps. Should treat it differently.

Modified Paths:
--------------
    trunk/pywikipedia/replace.py

Modified: trunk/pywikipedia/replace.py
===================================================================
--- trunk/pywikipedia/replace.py	2007-12-17 20:19:17 UTC (rev 4726)
+++ trunk/pywikipedia/replace.py	2007-12-17 20:27:11 UTC (rev 4727)
@@ -212,14 +212,14 @@
     def isTitleExcepted(self, title):
         if self.exceptions.has_key('title'):
             for exc in self.exceptions['title']:
-                if exc.find(title) > -1:
+                if exc.search(title):
                     return True
         return False
 
     def isTextExcepted(self, text):
         if self.exceptions.has_key('text-contains'):
             for exc in self.exceptions['text-contains']:
-                if exc.find(text) > -1:
+                if exc.search(text):
                     return True
         return False
 
@@ -274,7 +274,7 @@
         """
         if self.exceptions.has_key('title'):
             for exc in self.exceptions['title']:
-                if exc.find(title) > -1:
+                if exc.search(title):
                     return True
         return False
 
@@ -284,7 +284,7 @@
         """
         if self.exceptions.has_key('text-contains'):
             for exc in self.exceptions['text-contains']:
-                if exc.find(original_text) > -1:
+                if exc.search(original_text):
                     return True
         return False
 





More information about the Pywikipedia-l mailing list