http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11142
Revision: 11142 Author: xqt Date: 2013-03-01 12:32:51 +0000 (Fri, 01 Mar 2013) Log Message: ----------- use getSite().image_repository() as commons site
Modified Paths: -------------- trunk/pywikipedia/commons_link.py
Modified: trunk/pywikipedia/commons_link.py =================================================================== --- trunk/pywikipedia/commons_link.py 2013-03-01 12:19:30 UTC (rev 11141) +++ trunk/pywikipedia/commons_link.py 2013-03-01 12:32:51 UTC (rev 11142) @@ -70,7 +70,7 @@ for page in self.generator: try: pywikibot.output(u'\n>>>> %s <<<<' % page.title()) - commons = pywikibot.getSite('commons', 'commons') + commons = pywikibot.getSite().image_repository() commonspage = pywikibot.Page(commons, page.title()) try: getcommons = commonspage.get(get_redirect=True) @@ -123,7 +123,7 @@ for page in self.generator: try: pywikibot.output(u'\n>>>> %s <<<<' % page.title()) - getCommons = pywikibot.getSite('commons', 'commons') + commons = pywikibot.getSite().image_repository() commonsCategory = catlib.Category(getCommons, 'Category:%s' % page.title()) try: