jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/830187 )
Change subject: [IMPR] Improvements for dataextend.py
......................................................................
[IMPR] Improvements for dataextend.py
- add typing hints for html parameter
- add typing hints for findnames method
- always return a list with findnames
- update funcnames list in __getattr__
Change-Id: Ie9e84caac4c036ced97a42c9bf6b2139b34f496a
---
M scripts/dataextend.py
1 file changed, 2,668 insertions(+), 2,583 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/830187
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: Ie9e84caac4c036ced97a42c9bf6b2139b34f496a
Gerrit-Change-Number: 830187
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/829109 )
Change subject: [doc] Update ROADMAP.rst and CHANGELOG.rst
......................................................................
[doc] Update ROADMAP.rst and CHANGELOG.rst
Change-Id: I7b9e50e94711a0cacc97ef384fcad9fe99dba9ea
---
M ROADMAP.rst
M scripts/CHANGELOG.rst
2 files changed, 26 insertions(+), 6 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 2a9c1b8..717f301 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,7 +1,8 @@
Current release 7.7.0
^^^^^^^^^^^^^^^^^^^^^
-*(no changes yet)*
+* Raise KeyError instead of AttributeError if :class:`page.FileInfo` is used as Mapping
+* L10N updates
Deprecations
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index 165f1a1..87d02b6 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -1,16 +1,35 @@
Scripts Changelog
=================
-7.6.0
+7.7.0
-----
-*current release*
-
archivebot
~~~~~~~~~~
-* use ``User:MiszaBot/config`` as default template
-* raise MalformedConfigError if 'maxarchivesize' is 0 (:phab:`T313886`)
+* Add -sort option to sort archives by (latest) timestamp
+* Archive unsigned threads using timestamp of the next thread (:phab:`T69663`, :phab:`T182685`)
+
+create_isbn_edition
+~~~~~~~~~~~~~~~~~~~
+
+* New script to load ISBN related data into Wikidata (:phab:`T314942`)
+
+watchlist
+~~~~~~~~~
+
+* Enable watchlist.refresh_all for API generator access (:phab:`T316359`)
+
+7.6.0
+-----
+
+*21 August 2022*
+
+archivebot
+~~~~~~~~~~
+
+* Use ``User:MiszaBot/config`` as default template
+* Raise MalformedConfigError if 'maxarchivesize' is 0 (:phab:`T313886`)
* Preserve thread order in archive even if threads are archived later (:phab:`T312773`, :phab:`T314560`)
* Skip the page if it does not exist
* Fix for DiscussionPage.size() (:phab:`T313886`)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/829109
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: I7b9e50e94711a0cacc97ef384fcad9fe99dba9ea
Gerrit-Change-Number: 829109
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/826891 )
Change subject: [bugfix] Enable watchlist.refresh_all for API generator access
......................................................................
[bugfix] Enable watchlist.refresh_all for API generator access
Bug: T316359
Change-Id: I2b8ab1b3fd5eb75e7a466b569aa5ba5d004b9885
---
M scripts/watchlist.py
1 file changed, 8 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/watchlist.py b/scripts/watchlist.py
index 1b94bd4..d5135d9 100755
--- a/scripts/watchlist.py
+++ b/scripts/watchlist.py
@@ -84,7 +84,14 @@
entry._load_cache()
entry.parse_key()
entry._rebuild()
- if entry.site not in seen and 'watchlistraw' in entry._data:
+ if entry.site in seen:
+ continue
+
+ # for generator API usage we have to check the modules
+ modules = entry._params.get('modules', [])
+ modules_found = any(mod.endswith('watchlistraw') for mod in modules)
+ # for list API usage 'watchlistraw' is directly found
+ if modules_found or 'watchlistraw' in entry._data:
refresh(entry.site)
seen.add(entry.site)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/826891
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: I2b8ab1b3fd5eb75e7a466b569aa5ba5d004b9885
Gerrit-Change-Number: 826891
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
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/+/825392 )
Change subject: [IMPR] raise KeyError instead of AttributeError if FileInfo is used as Mapping
......................................................................
[IMPR] raise KeyError instead of AttributeError if FileInfo is used as Mapping
For mapping types, if key is missing, KeyError should be raised, see
https://docs.python.org/3/reference/datamodel.html?highlight=__getitem__#ob…
Change-Id: I84aef0a0b7033318c2f1d4ab850c65cb283a9210
---
M pywikibot/page/_filepage.py
1 file changed, 11 insertions(+), 3 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py
index 1616bb7..bd627e4 100644
--- a/pywikibot/page/_filepage.py
+++ b/pywikibot/page/_filepage.py
@@ -360,21 +360,29 @@
<pywikibot.site._apisite.APISite.loadimageinfo>` for details.
.. note:: timestamp will be casted to :func:`pywikibot.Timestamp`.
+
+ .. versionchanged:: 7.7
+ raises KeyError instead of AttributeError if FileInfo is used as
+ Mapping.
"""
def __init__(self, file_revision) -> None:
- """Initiate the class using the dict from `APISite.loadimageinfo`."""
+ """Initiate the class using the dict from ``APISite.loadimageinfo``."""
self.__dict__.update(file_revision)
self.timestamp = pywikibot.Timestamp.fromISOformat(self.timestamp)
def __getitem__(self, key):
"""Give access to class values by key."""
- return getattr(self, key)
+ try:
+ result = getattr(self, key)
+ except AttributeError as e:
+ raise KeyError(str(e).replace('attribute', 'key')) from None
+ return result
def __repr__(self) -> str:
"""Return a more complete string representation."""
return repr(self.__dict__)
def __eq__(self, other) -> bool:
- """Test if two File_info objects are equal."""
+ """Test if two FileInfo objects are equal."""
return self.__dict__ == other.__dict__
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/825392
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: I84aef0a0b7033318c2f1d4ab850c65cb283a9210
Gerrit-Change-Number: 825392
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-MessageType: merged