Revision: 5541 Author: nicdumz Date: 2008-06-08 21:56:51 +0000 (Sun, 08 Jun 2008)
Log Message: ----------- Committing a minor regex fix I got suggested by Dispenser
Modified Paths: -------------- trunk/pywikipedia/noreferences.py
Modified: trunk/pywikipedia/noreferences.py =================================================================== --- trunk/pywikipedia/noreferences.py 2008-06-08 21:48:23 UTC (rev 5540) +++ trunk/pywikipedia/noreferences.py 2008-06-08 21:56:51 UTC (rev 5541) @@ -309,7 +309,7 @@
# Is there an existing section where we can add the references tag? for section in wikipedia.translate(self.site, referencesSections): - sectionR = re.compile(r'\r\n=+ *%s *=+\r\n' % section) + sectionR = re.compile(r'\r\n=+ *%s *=+ *\r\n' % section) index = 0 while index < len(oldText): match = sectionR.search(oldText, index) @@ -327,7 +327,7 @@ # Create a new section for the references tag for section in wikipedia.translate(self.site, placeBeforeSections): # Find out where to place the new section - sectionR = re.compile(r'\r\n(?P<ident>=+) *%s *=+\r\n' % section) + sectionR = re.compile(r'\r\n(?P<ident>=+) *%s *(?P=ident) *\r\n' % section) index = 0 while index < len(oldText): match = sectionR.search(oldText, index)
pywikipedia-l@lists.wikimedia.org