jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1175250?usp=email )
Change subject: Doc: Update documentation for get_best_claim methods ...................................................................... Doc: Update documentation for get_best_claim methods - add version strings - add references notes - update ROADMAP.rst Change-Id: I91d37d637e621cb817174a73eb5bbf44dc7f6a67 --- M ROADMAP.rst M pywikibot/page/_page.py M pywikibot/page/_wikibase.py 3 files changed, 16 insertions(+), 7 deletions(-) Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved diff --git a/ROADMAP.rst b/ROADMAP.rst index 6ed218c..82d9331 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,7 +1,10 @@ Current Release Changes ======================= -* (no changes yet) +* Implement :meth:`pywikibot.ItemPage.get_best_claim` (:phab:`T400610`) +* Add *expiry* parameter to :meth:`BasePage.watch()<page.BasePage.watch>` and + :meth:`Site.watch()<pywikibot.site._apisite.APISite.watch>` (:phab:`T330839`) + Deprecations ============ diff --git a/pywikibot/page/_page.py b/pywikibot/page/_page.py index 18eb1e0..8a5a5a7 100644 --- a/pywikibot/page/_page.py +++ b/pywikibot/page/_page.py @@ -182,7 +182,7 @@ if save: self.save(**kwargs) - def get_best_claim(self, prop: str): + def get_best_claim(self, prop: str) -> pywikibot.Claim | None: """Return the first best Claim for this page. Return the first 'preferred' ranked Claim specified by Wikibase @@ -190,10 +190,12 @@ .. versionadded:: 3.0 - :param prop: property id, "P###" + .. seealso:: :meth:`pywikibot.ItemPage.get_best_claim` + + :param prop: Wikibase property ID, must be of the form ``P`` + followed by one or more digits (e.g. ``P31``). :return: Claim object given by Wikibase property number for this page object. - :rtype: pywikibot.Claim or None :raises UnknownExtensionError: site has no Wikibase extension """ diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py index bc2e5c2..3c1df0a 100644 --- a/pywikibot/page/_wikibase.py +++ b/pywikibot/page/_wikibase.py @@ -1341,16 +1341,20 @@ return self._isredir return super().isRedirectPage() - def get_best_claim(self, prop: str): + def get_best_claim(self, prop: str) -> pywikibot.Claim | None: """Return the first best Claim for this page. Return the first 'preferred' ranked Claim specified by Wikibase property or the first 'normal' one otherwise. - :param prop: property id, "P###" + .. versionadded:: 10.4 + + .. seealso:: :meth:`pywikibot.Page.get_best_claim` + + :param prop: Wikibase property ID, must be of the form ``P`` + followed by one or more digits (e.g. ``P31``). :return: Claim object given by Wikibase property number for this page object. - :rtype: pywikibot.Claim or None :raises UnknownExtensionError: site has no Wikibase extension """ -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1175250?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I91d37d637e621cb817174a73eb5bbf44dc7f6a67 Gerrit-Change-Number: 1175250 Gerrit-PatchSet: 2 Gerrit-Owner: Xqt <i...@gno.de> Gerrit-Reviewer: Xqt <i...@gno.de> Gerrit-Reviewer: jenkins-bot
_______________________________________________ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org