Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1074554?usp=email )
Change subject: [doc] update ROADMAP.rst and documentation ......................................................................
[doc] update ROADMAP.rst and documentation
Change-Id: Ic94013d7a403aa1651567527a4d194b7650f17f1 --- M ROADMAP.rst M pywikibot/page/_wikibase.py 2 files changed, 15 insertions(+), 9 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved
diff --git a/ROADMAP.rst b/ROADMAP.rst index b1e6268..4c2f745 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,6 +1,7 @@ Current Release Changes =======================
+* Add :meth:`title()<pywikibot.MediaInfo.title>` method to :class:`pywikibot.MediaInfo` (:phab:`T366424`) * Add tags to the wikibase functions (:phab:`T372513`) * :func:`diff.get_close_matches_ratio()` function was added * Initialize super classes of :exc:`EditReplacementError` (:phab:`T212740`) diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py index 5ebe25d..1e76780 100644 --- a/pywikibot/page/_wikibase.py +++ b/pywikibot/page/_wikibase.py @@ -510,22 +510,27 @@ # reloading files without MediaInfo will fail. return super().get()
- def getID(self, numeric: bool = False): - """ - Get the entity identifier. + def getID(self, numeric: bool = False) -> str | int: + """Get the entity identifier. + + .. seealso:: :meth:`title`
:param numeric: Strip the first letter and return an int - :raise NoWikibaseEntityError: if this entity is associated with - a non-existing file + :raises NoWikibaseEntityError: if this entity is associated with + a non-existing file """ self._assert_has_id() return super().getID(numeric=numeric)
- def title(self): - """ - Return ID as title of the MediaInfo. + def title(self) -> str: + """Return ID as title of the MediaInfo.
- :return: str: the entity identifier + .. versionadded:: 9.4 + .. seealso:: :meth:`getID` + + :raises NoWikibaseEntityError: if this entity is associated with + a non-existing file + :return: the entity identifier """ return self.getID()
pywikibot-commits@lists.wikimedia.org