jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/376193 )
Change subject: [bugfix] use pywikibot.page.WikibasePage ......................................................................
[bugfix] use pywikibot.page.WikibasePage
- also use ItemPage for deprecation warnings
Bug: T175115 Change-Id: Ic25a1cf26f381eaa9fcdd9b1526ed4cb69f49853 --- M pywikibot/pagegenerators.py M pywikibot/site.py 2 files changed, 10 insertions(+), 10 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 73934ef..f4cddd9 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -1576,7 +1576,7 @@ @return: true if page contains the claim, false otherwise @rtype: bool """ - if not isinstance(page, pywikibot.WikibasePage): + if not isinstance(page, pywikibot.page.WikibasePage): try: page = pywikibot.ItemPage.fromPage(page) except pywikibot.NoPage: diff --git a/pywikibot/site.py b/pywikibot/site.py index f637342..1f8f534 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -7358,18 +7358,18 @@ if props == 'info': instead = ( '\n' - "{'lastrevid': WikibasePage.latest_revision_id,\n" - " 'pageid': WikibasePage.pageid,\n" - " 'title': WikibasePage.title(),\n" - " 'modified': WikibasePage._timestamp,\n" - " 'ns': WikibasePage.namespace(),\n" - " 'type': WikibasePage.entity_type, # for subclasses\n" - " 'id': WikibasePage.id" + "{'lastrevid': ItemPage.latest_revision_id,\n" + " 'pageid': ItemPage.pageid,\n" + " 'title': ItemPage.title(),\n" + " 'modified': ItemPage._timestamp,\n" + " 'ns': ItemPage.namespace(),\n" + " 'type': ItemPage.entity_type, # for subclasses\n" + " 'id': ItemPage.id" '}\n') elif props == 'sitelinks': instead = 'ItemPage.sitelinks' elif props in ('aliases', 'labels', 'descriptions'): - instead = ('WikibasePage.{0} after WikibasePage.get()' + instead = ('ItemPage.{0} after ItemPage.get()' .format(attr)) else: # urls instead = None @@ -7398,7 +7398,7 @@ "API wbgetentities response lacks %s key" % props return wbdata[props]
- @deprecated("pywikibot.WikibasePage") + @deprecated('pywikibot.ItemPage') def get_item(self, source, **params): """Get the data for multiple Wikibase items.""" return self._get_item(source, **params)
pywikibot-commits@lists.wikimedia.org