Skip to content

Commit

Permalink
[doc] Update ROADMAP.rst and some documentation
Browse files Browse the repository at this point in the history
Change-Id: I76317e4cebcf865062f5a501253d2494c4ce957a
  • Loading branch information
xqt committed Sep 18, 2023
1 parent da5d40e commit f44bf4a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
7 changes: 7 additions & 0 deletions ROADMAP.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Current release
---------------

* *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its *paraminfo_keys* class attribute
and its *preloaded_modules* property was deprecated, the :meth:`data.api.ParamInfo.normalize_paraminfo`
method became a staticmethod (:phab:`T306637`)
* raise ValueError when :class:`pywikibot.FilePage` title doesn't have a valid file extension (:phab:`T345786`)
* :attr:`site.APISite.file_extensions <pywikibot.site._apisite.APISite.file_extensions>` property was added (:phab:`T345786`)
* Extract code and family from dbname in :meth:`site.APISite.fromDBName()
<pywikibot.site._apisite.APISite.fromDBName>` (:phab:`T345036`)
* ``dropdelay`` and ``releasepid`` attributes of :class:`throttle.Throttle` where deprecated
Expand All @@ -16,6 +21,8 @@ Current release
Deprecations
------------

* 8.4.0: *modules_only_mode* parameter of :class:`data.api.ParamInfo`, its *paraminfo_keys* class attribute
and its preloaded_modules property will be removed
* 8.4.0: *dropdelay* and *releasepid* attributes of :class:`throttle.Throttle` will be removed
in favour of *expiry* class attribute
* 8.2.0: :func:`tools.itertools.itergroup` will be removed in favour of :func:`backports.batched`
Expand Down
19 changes: 15 additions & 4 deletions pywikibot/page/_filepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,25 @@

class FilePage(Page):

"""
A subclass of Page representing a file description page.
"""A subclass of Page representing a file description page.
Supports the same interface as Page, with some added methods.
Supports the same interface as Page except *ns*; some added methods.
"""

def __init__(self, source, title: str = '') -> None:
"""Initializer."""
"""Initializer.
.. versionchanged:: 8.4
check for valid extensions.
:param source: the source of the page
:type source: pywikibot.page.BaseLink (or subclass),
pywikibot.page.Page (or subclass), or pywikibot.page.Site
:param title: normalized title of the page; required if source is a
Site, ignored otherwise
:raises ValueError: Either the title is not in the file
namespace or does not have a valid extension.
"""
self._file_revisions = {} # dictionary to cache File history.
super().__init__(source, title, 6)
if self.namespace() != 6:
Expand Down
5 changes: 4 additions & 1 deletion pywikibot/site/_apisite.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ def logout(self) -> None:

@property
def file_extensions(self) -> List[str]:
"""File extensions enabled on the wiki."""
"""File extensions enabled on the wiki.
.. versionadded:: 8.4
"""
return sorted(e['ext'] for e in self.siteinfo.get('fileextensions'))

@property
Expand Down
5 changes: 5 additions & 0 deletions scripts/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Scripts Changelog

* L10N for several scripts

category_graph
~~~~~~~~~~~~~~

* Wrap DOT-string in curly braces (:phab:`T346007`)

checkimages
~~~~~~~~~~~

Expand Down

0 comments on commit f44bf4a

Please sign in to comment.