jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/958522 )
Change subject: [doc] Update ROADMAP.rst and some documentation
......................................................................
[doc] Update ROADMAP.rst and some documentation
Change-Id: I76317e4cebcf865062f5a501253d2494c4ce957a
---
M ROADMAP.rst
M scripts/CHANGELOG.rst
M pywikibot/page/_filepage.py
M pywikibot/site/_apisite.py
4 files changed, 40 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 74b3d74..20647e7 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -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
@@ -16,6 +21,8 @@
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`
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 0161835..4cb91fe 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -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:
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 1a1f0ee..99be28c 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -473,7 +473,10 @@
@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
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index 6403ea8..f87830d 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -6,6 +6,11 @@
* L10N for several scripts
+category_graph
+~~~~~~~~~~~~~~
+
+* Wrap DOT-string in curly braces (:phab:`T346007`)
+
checkimages
~~~~~~~~~~~
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/958522
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I76317e4cebcf865062f5a501253d2494c4ce957a
Gerrit-Change-Number: 958522
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/956098 )
Change subject: Wrap DOT-string in curly braces in category_graph.py
......................................................................
Wrap DOT-string in curly braces in category_graph.py
Invalid DOT-string in category_graph.py caused TypeError exception when
running category_graph.py. Wrapped the DOT-string in curly braces in
argument passed to pydot.graph_from_dot_data() so that the DOT-string is
in line with the pydot documentation.
Wrap DOT-string in additional set of curly braces.
I forgot the second set of curly braces in the original commit and am
adding them in this commit. The second braces escape the first set of
braces and resolve "style" in the argument.
Bug: T346007
Change-Id: I635e077240b7d6441d5349edf261ba00a96748e7
---
M scripts/category_graph.py
1 file changed, 22 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/category_graph.py b/scripts/category_graph.py
index fd97b8c..0d875b2 100755
--- a/scripts/category_graph.py
+++ b/scripts/category_graph.py
@@ -90,7 +90,7 @@
f'node [newrank=true shape=plaintext {font}] ' \
f'edge [arrowhead=open labeldistance=3 ' \
f'labelfontcolor="#00000080" {font}] ' + args.style
- self.dot = pydot.graph_from_dot_data(f'digraph {style}')[0]
+ self.dot = pydot.graph_from_dot_data(f'digraph {{{style}}}')[0]
self.dot.set_name(f'"{cat_title}"')
def scan_level(self, cat, level, hue=None) -> str:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/956098
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I635e077240b7d6441d5349edf261ba00a96748e7
Gerrit-Change-Number: 956098
Gerrit-PatchSet: 4
Gerrit-Owner: Enag2000 <enag2000(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged