jenkins-bot has submitted this change and it was merged.
Change subject: WDQ: yield ItemPages for DataSite ......................................................................
WDQ: yield ItemPages for DataSite
Add a mode that WikidataQueryPageGenerator will generate ItemPage from the WikidataQuery, if a DataSite is given as site.
Change-Id: I04010c199bb346f54554567166b36a64d5eabec3 --- M pywikibot/pagegenerators.py 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 6f01605..68cae1b 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -2251,6 +2251,10 @@ pywikibot.output(u'retrieved %d items' % data[u'status'][u'items']) for item in data[u'items']: page = pywikibot.ItemPage(repo, u'Q{0}'.format(item)) + if isinstance(site, pywikibot.site.DataSite): + yield page + continue + try: link = page.getSitelink(site) except pywikibot.NoPage:
pywikibot-commits@lists.wikimedia.org