http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11237
Revision: 11237 Author: drtrigon Date: 2013-03-22 22:01:35 +0000 (Fri, 22 Mar 2013) Log Message: ----------- follow-up; to r11070 and r11071 in order to use proper syntax
Modified Paths: -------------- trunk/pywikipedia/subster.py
Modified: trunk/pywikipedia/subster.py =================================================================== --- trunk/pywikipedia/subster.py 2013-03-22 21:27:19 UTC (rev 11236) +++ trunk/pywikipedia/subster.py 2013-03-22 22:01:35 UTC (rev 11237) @@ -178,7 +178,11 @@ self._ConfCSSpostprocPage = pywikibot.Page(self.site, bot_config['ConfCSSpostproc']) self._ConfCSSconfigPage = pywikibot.Page(self.site, bot_config['ConfCSSconfig']) self.pagegen = pagegenerators.ReferringPageGenerator(self._userListPage, onlyTemplateInclusion=True) - if not (self.site.family.name == 'wikidata'): + if (self.site.family.name == 'wikidata'): + # http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11070 + # http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11071 + self.site = self.site.data_repository() + else: # DRTRIGON-130; skip this for test-repo self._code = self._ConfCSSpostprocPage.get() pywikibot.output(u'Imported postproc %s rev %s from %s' %\ @@ -218,7 +222,7 @@ # output result to page or return directly if sim: return substed_content - elif (self.site.family.name == 'wikidata'): # DRTRIGON-130 + elif self.site.is_data_repository(): # DRTRIGON-130 # convert talk page result to wikidata(base) data = self.WD_convertContent(substed_content) datapage = pywikibot.DataPage(self.site, page.title())
pywikipedia-svn@lists.wikimedia.org