Skip to content

Commit

Permalink
[doc] update ROADMAP.rst and documentation
Browse files Browse the repository at this point in the history
Change-Id: Ic94013d7a403aa1651567527a4d194b7650f17f1
  • Loading branch information
xqt committed Sep 21, 2024
1 parent dfdc1f8 commit cfdf72b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -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`)
Expand Down
23 changes: 14 additions & 9 deletions pywikibot/page/_wikibase.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,22 +510,27 @@ def get(self, force: bool = False) -> dict:
# 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.
.. versionadded:: 9.4
.. seealso:: :meth:`getID`
:return: str: the entity identifier
:raises NoWikibaseEntityError: if this entity is associated with
a non-existing file
:return: the entity identifier
"""
return self.getID()

Expand Down

0 comments on commit cfdf72b

Please sign in to comment.