Revision: 6559 Author: nicdumz Date: 2009-03-26 06:00:33 +0000 (Thu, 26 Mar 2009)
Log Message: ----------- [ 2672346 ] selflink.py contains invalid characters and does not start (Mikko Silvonen)
Modified Paths: -------------- trunk/pywikipedia/selflink.py
Modified: trunk/pywikipedia/selflink.py =================================================================== --- trunk/pywikipedia/selflink.py 2009-03-26 02:10:20 UTC (rev 6558) +++ trunk/pywikipedia/selflink.py 2009-03-26 06:00:33 UTC (rev 6559) @@ -72,12 +72,12 @@ mysite = wikipedia.getSite() dump = xmlreader.XmlDump(self.xmlFilename) for entry in dump.parse(): - if mysite.nocapitalize: - title = re.escape(entry.title) - else: - title = '[%s%s]%s' % (re.escape(entry.title[0].lower()), - re.escape(entry.title[0].upper()), - re.escape(entry.title[1:])) + if mysite.nocapitalize: + title = re.escape(entry.title) + else: + title = '[%s%s]%s' % (re.escape(entry.title[0].lower()), + re.escape(entry.title[0].upper()), + re.escape(entry.title[1:])) selflinkR = re.compile(r'[[' + title + '(|[^]]*)?]]') if selflinkR.search(entry.text): yield wikipedia.Page(mysite, entry.title)
pywikipedia-l@lists.wikimedia.org