Revision: 5003 Author: rotem Date: 2008-02-10 17:58:15 +0000 (Sun, 10 Feb 2008)
Log Message: ----------- Don't filter pages if the namespaces list is empty.
Modified Paths: -------------- trunk/pywikipedia/interwiki.py
Modified: trunk/pywikipedia/interwiki.py =================================================================== --- trunk/pywikipedia/interwiki.py 2008-02-10 10:53:06 UTC (rev 5002) +++ trunk/pywikipedia/interwiki.py 2008-02-10 17:58:15 UTC (rev 5003) @@ -1548,12 +1548,12 @@ optRestore = True elif arg == '-continue': optContinue = True - # deprecated for consistency with other scripts elif arg.startswith('-namespace:'): try: namespaces.append(int(arg[11:])) except ValueError: namespaces.append(arg[11:]) + # deprecated for consistency with other scripts elif arg.startswith('-number:'): number = int(arg[8:]) elif arg.startswith('-neverlink:'): @@ -1618,7 +1618,8 @@ bot = InterwikiBot()
if hintlessPageGen: - hintlessPageGen = pagegenerators.NamespaceFilterPageGenerator(hintlessPageGen, namespaces) + if len(namespaces) > 0: + hintlessPageGen = pagegenerators.NamespaceFilterPageGenerator(hintlessPageGen, namespaces) # we'll use iter() to create make a next() function available. bot.setPageGenerator(iter(hintlessPageGen), number = number) elif warnfile:
pywikipedia-l@lists.wikimedia.org