Revision: 7850 Author: xqt Date: 2010-01-02 12:59:20 +0000 (Sat, 02 Jan 2010)
Log Message: ----------- empty list/dict is not None
Modified Paths: -------------- trunk/pywikipedia/cosmetic_changes.py
Modified: trunk/pywikipedia/cosmetic_changes.py =================================================================== --- trunk/pywikipedia/cosmetic_changes.py 2009-12-31 17:56:33 UTC (rev 7849) +++ trunk/pywikipedia/cosmetic_changes.py 2010-01-02 12:59:20 UTC (rev 7850) @@ -318,20 +318,20 @@ if self.site.language()=='nn': regex = re.compile('(<!-- ?interwiki \(no(/nb)?, ?sv, ?da first; then other languages alphabetically by name\) ?-->)') found = regex.findall(text) - if found != []: + if found: if pywikibot.verbose: print found hasCommentLine = True text = regex.sub('', text)
# Adding categories - if categories != None: + if categories: text = pywikibot.replaceCategoryLinks(text, categories, site = self.site) # Put the nn iw message back - if self.site.language()=='nn' and not self.talkpage and (interwikiLinks != None or hasCommentLine): + if self.site.language()=='nn' and not self.talkpage and (interwikiLinks or hasCommentLine): text = text + '\r\n\r\n' + nn_iw_msg # Adding stars templates - if allstars != []: + if allstars: text = text.strip()+self.site.family.interwiki_text_separator allstars.sort() for element in allstars: @@ -339,7 +339,7 @@ if pywikibot.verbose: pywikibot.output(u'%s' %element.strip()) # Adding the interwiki - if interwikiLinks != None: + if interwikiLinks: text = pywikibot.replaceLanguageLinks(text, interwikiLinks, site = self.site, template = self.template, template_subpage = subpage) return text
pywikipedia-svn@lists.wikimedia.org