Revision: 4443 Author: russblau Date: 2007-10-12 23:52:44 +0000 (Fri, 12 Oct 2007)
Log Message: ----------- Fixed FileLinksGenerator bug identified by Siebrand on mailing list, plus another one I found while solving the first one.
Modified Paths: -------------- trunk/pywikipedia/pagegenerators.py
Modified: trunk/pywikipedia/pagegenerators.py =================================================================== --- trunk/pywikipedia/pagegenerators.py 2007-10-12 20:17:31 UTC (rev 4442) +++ trunk/pywikipedia/pagegenerators.py 2007-10-12 23:52:44 UTC (rev 4443) @@ -676,7 +676,12 @@ fileLinksPageTitle = arg[11:] if not fileLinksPageTitle: fileLinksPageTitle = wikipedia.input(u'Links to which image page should be processed?') - fileLinksPage = wikipedia.Page(wikipedia.getSite(), 'Image:' + fileLinksPageTitle) + if fileLinksPageTitle.startswith(wikipedia.getSite().namespace(6) + ":"): + fileLinksPage = wikipedia.ImagePage(wikipedia.getSite(), + fileLinksPageTitle) + else: + fileLinksPage = wikipedia.ImagePage(wikipedia.getSite(), + 'Image:' + fileLinksPageTitle) gen = FileLinksGenerator(fileLinksPage) elif arg.startswith('-unusedfiles'): if len(arg) == 12: