jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1025788?usp=email )
Change subject: [IMPR] Improvements for interwiki.py
......................................................................
[IMPR] Improvements for interwiki.py
- update documentation
- add typing hints
- raise RuntimeError in whatsNextPageBatch without preleading 'BUG:
because 'RuntimeError:' is already shown
- site objects are processed not languages
Change-Id: I56984020c20a3c691ad5f40b73aac376b1797416
---
M scripts/interwiki.py
1 file changed, 9 insertions(+), 10 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 33102ef..61a13fe 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -750,19 +750,19 @@
"""
return self.todo.iter_values_len()
- def whatsNextPageBatch(self, site):
- """
- Return the next page batch.
+ def whatsNextPageBatch(self, site) -> list[pywikibot.Page]:
+ """Return the next page batch.
- By calling this method, you 'promise' this instance that you will
- preload all the 'site' Pages that are in the todo list.
+ By calling this method, you 'promise' this instance that you
+ will preload all the *site* Pages that are in the todo list.
- This routine will return a list of pages that can be treated.
+ :return: This routine will return a list of pages that can be
+ treated.
"""
# Bug-check: Isn't there any work still in progress? We can't work on
# different sites at a time!
if self.pending:
- raise RuntimeError(f"BUG: Can't start to work on {site}; still "
+ raise RuntimeError(f"Can't start to work on {site}; still "
f'working on {self.pending}')
# Prepare a list of suitable pages
result = []
@@ -1402,8 +1402,7 @@
pywikibot.info(f'Found link to {page2} in:')
self.whereReport(page2, indent=4)
- # TODO: allow answer to repeat previous or go back
- # after a mistake
+ # TODO: allow answer to repeat previous or go back after a mistake
answer = 'a' if acceptall else pywikibot.input_choice(
'What should be done?',
[('accept', 'a'), ('reject', 'r'), ('give up', 'g'),
@@ -1921,7 +1920,7 @@
Return the site that has the most open queries plus the number.
If there is nothing left, return None.
- Only languages that are TODO for the first Subject are returned.
+ Only sites that are todo for the first Subject are returned.
"""
if not self.firstSubject():
return None
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1025788?usp=email
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: I56984020c20a3c691ad5f40b73aac376b1797416
Gerrit-Change-Number: 1025788
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/+/1024934?usp=email )
Change subject: [doc] fix spelling mistakes
......................................................................
[doc] fix spelling mistakes
Change-Id: I06bc7c07d5b2e4cb344730dc45ee1c6a6e132a93
---
M HISTORY.rst
M pywikibot/tools/_deprecate.py
2 files changed, 4 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index d8d60f1..3415a6d 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -5,8 +5,8 @@
-----
*27 April 2024*
-* Add support for new wikis
- (:phab:`T363272`, :phab:`T363265`, :phab:`T363258`, :phab:`T363251`, :phab:`T363245`, :phab:`T360312`, :phab:`T360305`)
+* Add support for new wikis (:phab:`T363272`, :phab:`T363265`, :phab:`T363258`,
+ :phab:`T363251`, :phab:`T363245`, :phab:`T360312`, :phab:`T360305`)
* i18n updates
@@ -1094,7 +1094,7 @@
* Property.getType() method has been removed
* Family.server_time() method was removed; it is still available from Site object (:phab:`T89451`)
* All HttpRequest parameters except of charset has been dropped (:phab:`T265206`)
-* A lot of methods and properties of HttpRequest are deprecared in favour of requests.Resonse attributes
+* A lot of methods and properties of HttpRequest are deprecated in favour of requests.Resonse attributes
(:phab:`T265206`)
* Method and properties of HttpRequest are delegated to requests.Response object (:phab:`T265206`)
* comms.threadedhttp.HttpRequest.raw was replaced by HttpRequest.content property (:phab:`T265206`)
diff --git a/pywikibot/tools/_deprecate.py b/pywikibot/tools/_deprecate.py
index 74e2bcf..58409ac 100644
--- a/pywikibot/tools/_deprecate.py
+++ b/pywikibot/tools/_deprecate.py
@@ -313,7 +313,7 @@
def my_function(bar='baz'): pass
# replaces 'foo' keyword by 'bar' used by my_function
- @deprecare_arg('foo', None)
+ @deprecate_arg('foo', None)
def my_function(): pass
# ignores 'foo' keyword no longer used by my_function
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1024934?usp=email
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: I06bc7c07d5b2e4cb344730dc45ee1c6a6e132a93
Gerrit-Change-Number: 1024934
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged