jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1030040?usp=email )
Change subject: [IMPR] adding documentation to commons_information.py
......................................................................
[IMPR] adding documentation to commons_information.py
Adding standard documentation to commons_information.py and fixing some typos inside
Bug: T349269
Change-Id: Ie1919407a48041c7d90856e8090078658cc9d6b4
---
M scripts/commons_information.py
1 file changed, 24 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index 8c2fe59..138f842 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -1,7 +1,25 @@
#!/usr/bin/env python3
-"""Insert a language template into the description field."""
+"""
+This bot adds a language template to the file's description field.
+
+This script understands the following command-line arguments:
+
+¶ms;
+
+Usage:
+
+ python pwb.py commons_information [pagegenerators]
+
+You can use any typical pagegenerator (like categories) to provide with a
+list of pages.
+
+Example for going through all files:
+
+ python pwb.py commons_information -start:File:!
+
+"""
#
-# (C) Pywikibot team, 2015-2023
+# (C) Pywikibot team, 2015-2024
#
# Distributed under the terms of the MIT license.
#
@@ -15,6 +33,9 @@
from pywikibot import i18n, pagegenerators
from pywikibot.bot import ExistingPageBot, SingleSiteBot
+# This is required for the text that is shown when you run this script
+# with the parameter -help or without parameters.
+docuReplacements = {'¶ms;': pagegenerators.parameterHelp} # noqa: N816
try:
import langdetect
@@ -52,7 +73,7 @@
@staticmethod
def detect_langs(text):
- """Detect language from griven text."""
+ """Detect language from given text."""
if langdetect is not None:
return langdetect.detect_langs(text)
return None
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1030040?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: Ie1919407a48041c7d90856e8090078658cc9d6b4
Gerrit-Change-Number: 1030040
Gerrit-PatchSet: 3
Gerrit-Owner: Rubin <rubin.happy(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
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1030155?usp=email )
Change subject: [doc] Fix sphinx role in SparqlQuery
......................................................................
[doc] Fix sphinx role in SparqlQuery
Change-Id: I0e93e1fa927c9e1728a0e011072bc22698690d6e
---
M pywikibot/data/sparql.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/data/sparql.py b/pywikibot/data/sparql.py
index 95bd47d..69e26e8 100644
--- a/pywikibot/data/sparql.py
+++ b/pywikibot/data/sparql.py
@@ -1,6 +1,6 @@
"""SPARQL Query interface."""
#
-# (C) Pywikibot team, 2016-2023
+# (C) Pywikibot team, 2016-2024
#
# Distributed under the terms of the MIT license.
#
@@ -140,7 +140,7 @@
"""Run SPARQL query and return parsed JSON result.
.. versionchanged:: 8.5
- :exc:``exceptions.NoUsernameError` is raised if the response
+ :exc:`exceptions.NoUsernameError` is raised if the response
looks like the user is not logged in.
:param query: Query text
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1030155?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: I0e93e1fa927c9e1728a0e011072bc22698690d6e
Gerrit-Change-Number: 1030155
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/+/1029623?usp=email )
Change subject: [IMPR] make Subject.get_alternative() a static method, class isn't used
......................................................................
[IMPR] make Subject.get_alternative() a static method, class isn't used
Change-Id: I47450fc84884fed44c6d67c3d82395ae6fb52630
---
M scripts/interwiki.py
1 file changed, 2 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 61a13fe..3e3e8f0 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -821,8 +821,8 @@
or self.namespaceMismatch(page, target, counter) \
or self.wiktionaryMismatch(target)
+ @staticmethod
def get_alternative(
- self,
site: pywikibot.site.BaseSite
) -> pywikibot.Page | None:
"""Ask for an alternative Page for a given site.
@@ -831,10 +831,7 @@
"""
title = pywikibot.input(f'Give the alternative page for code '
f'{site.code!r} (without site code)')
- if title:
- return pywikibot.Page(site, title)
-
- return None
+ return pywikibot.Page(site, title) if title else None
def namespaceMismatch(self, linkingPage, linkedPage, counter) -> bool:
"""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029623?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: I47450fc84884fed44c6d67c3d82395ae6fb52630
Gerrit-Change-Number: 1029623
Gerrit-PatchSet: 2
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/+/1029487?usp=email )
Change subject: [fix] retry api request on ServerError
......................................................................
[fix] retry api request on ServerError
Again retry api request on ServerError but without FatalServerError.
ServerError is raised when a requests.ReadTimeout
or requests.ConnectTimeout occurs.
This partially reverts commit 1df22074e5b7484295cedbcd897beb70bf50521a.
Bug: T364275
Bug: T364393
Change-Id: I988cf7c824fd634e1c15092ef9471d58b5434074
---
M pywikibot/data/api/_requests.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
Matěj Suchánek: Looks good to me, approved
diff --git a/pywikibot/data/api/_requests.py b/pywikibot/data/api/_requests.py
index 2cc5cb7..b6afb6b 100644
--- a/pywikibot/data/api/_requests.py
+++ b/pywikibot/data/api/_requests.py
@@ -30,10 +30,10 @@
from pywikibot.exceptions import (
Client414Error,
Error,
+ FatalServerError,
MaxlagTimeoutError,
NoUsernameError,
Server504Error,
- ServerError,
SiteDefinitionError,
)
from pywikibot.login import LoginStatus
@@ -694,7 +694,7 @@
pywikibot.warning(
'Caught HTTP 414 error, although not using GET.')
raise
- except (ConnectionError, ServerError):
+ except (ConnectionError, FatalServerError):
# This error is not going to be fixed by just waiting
pywikibot.error(traceback.format_exc())
raise
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029487?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: I988cf7c824fd634e1c15092ef9471d58b5434074
Gerrit-Change-Number: 1029487
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: Masti <mastigm(a)gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: JAn Dudík <jan.dudik(a)gmail.com>
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029479?usp=email )
Change subject: [doc] Fix spelling mistake
......................................................................
[doc] Fix spelling mistake
Change-Id: I635d9fbc6167b7797d88c6523cda0d6d0e5f2b64
---
M pywikibot/site/_generators.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/site/_generators.py b/pywikibot/site/_generators.py
index c695523..bdb7b63 100644
--- a/pywikibot/site/_generators.py
+++ b/pywikibot/site/_generators.py
@@ -999,7 +999,7 @@
needs a lot of time on Wikidata site. You have to increase
the **read** timeout part of ``socket_timeout`` in
:ref:`Http Settings` in your ``user-config.py`` file. Or
- increase it patially within your code like:
+ increase it partially within your code like:
.. code:: python
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1029479?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: I635d9fbc6167b7797d88c6523cda0d6d0e5f2b64
Gerrit-Change-Number: 1029479
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-MessageType: merged