Revision: 8088 Author: xqt Date: 2010-04-13 12:24:36 +0000 (Tue, 13 Apr 2010)
Log Message: ----------- Do not collect Link_GA/Link_FA templates from DisabledParts.
Modified Paths: -------------- trunk/pywikipedia/add_text.py trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/add_text.py =================================================================== --- trunk/pywikipedia/add_text.py 2010-04-13 11:18:00 UTC (rev 8087) +++ trunk/pywikipedia/add_text.py 2010-04-13 12:24:36 UTC (rev 8088) @@ -250,10 +250,11 @@ newtext = newtext + u'\n' + nn_iw_msg # Dealing the stars' issue allstars = [] + starstext = wikipedia.removeDisabledParts(text) for star in starsList: regex = re.compile('({{(?:template:|)%s|.*?}}[\s]*)' % star, re.I) - found = regex.findall(newtext) + found = regex.findall(starstext) if found != []: newtext = regex.sub('', newtext) allstars += found
Modified: trunk/pywikipedia/cosmetic_changes.py =================================================================== --- trunk/pywikipedia/cosmetic_changes.py 2010-04-13 11:18:00 UTC (rev 8087) +++ trunk/pywikipedia/cosmetic_changes.py 2010-04-13 12:24:36 UTC (rev 8088) @@ -362,9 +362,10 @@ # Removing the interwiki text = pywikibot.removeLanguageLinks(text, site = self.site) # Removing the stars' issue + starstext = pywikibot.removeDisabledParts(text) for star in starsList: regex = re.compile('({{(?:template:|)%s|.*?}}[\s]*)' % star, re.I) - found = regex.findall(text) + found = regex.findall(starstext) if found != []: if pywikibot.verbose: print found @@ -699,6 +700,7 @@ 'ref', 'source', 'startspace', + 'inputbox', ] # do not change inside file links namespaces = list(self.site.namespace(6, all = True))