jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/757884 )
Change subject: [FIX] Use appropriate error `InvalidTitleError`
......................................................................
[FIX] Use appropriate error `InvalidTitleError`
... and fix some minor typos in the CONTENT.rst file.
Bug: T223895
Change-Id: Ia61b755630db081a481d57c53ba39fc751174e2f
---
M CONTENT.rst
M pywikibot/page/__init__.py
M tests/page_tests.py
3 files changed, 7 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CONTENT.rst b/CONTENT.rst
index e43f649..7f66c32 100644
--- a/CONTENT.rst
+++ b/CONTENT.rst
@@ -14,7 +14,7 @@
+---------------------------+-----------------------------------------------------------+
| Dockerfile | Assemble a Docker image, install all dependencies via pip |
+---------------------------+-----------------------------------------------------------+
- | Dockerfile-dev | Docker image including developement dependencies |
+ | Dockerfile-dev | Docker image including development dependencies |
+---------------------------+-----------------------------------------------------------+
| HISTORY.rst | PyPI version history file |
+---------------------------+-----------------------------------------------------------+
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index be3da73..c389ff4 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -5149,8 +5149,8 @@
if specified, present title using onsite local namespace,
otherwise use self canonical namespace.
- :raise pywikibot.exceptions.Error: no corresponding namespace is found
- in onsite
+ :raise pywikibot.exceptions.InvalidTitleError: no corresponding
+ namespace is found in onsite
"""
if onsite is None:
name = self.namespace.canonical_name
@@ -5162,8 +5162,8 @@
name = namespace.custom_name
break
else:
- raise Error(
- 'No corresponding namespace found for namespace {} on {}.'
+ raise InvalidTitleError(
+ 'No corresponding title found for namespace {} on {}.'
.format(self.namespace, onsite))
if self.namespace != Namespace.MAIN:
diff --git a/tests/page_tests.py b/tests/page_tests.py
index 92e6b98..330b211 100644
--- a/tests/page_tests.py
+++ b/tests/page_tests.py
@@ -166,8 +166,8 @@
source=self.enws)
self.assertEqual(l3.ns_title(), 'Translation:Albert Einstein')
with self.assertRaisesRegex(
- Error,
- 'No corresponding namespace found for '
+ InvalidTitleError,
+ 'No corresponding title found for '
'namespace Translation: on wikisource:it.'):
l3.ns_title(onsite=self.itws)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/757884
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: Ia61b755630db081a481d57c53ba39fc751174e2f
Gerrit-Change-Number: 757884
Gerrit-PatchSet: 5
Gerrit-Owner: 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/+/756119 )
Change subject: [cleanup] Remove interwiki.PageTree and use SizedKeyCollection directly
......................................................................
[cleanup] Remove interwiki.PageTree and use SizedKeyCollection directly
Change-Id: I27b786642c525a12a6f6686d054a99283a2251c1
---
M pywikibot/tools/__init__.py
M scripts/interwiki.py
2 files changed, 7 insertions(+), 37 deletions(-)
Approvals:
D3r1ck01: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index ec381a2..c201689 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -1,6 +1,6 @@
"""Miscellaneous helper functions (not wiki-dependent)."""
#
-# (C) Pywikibot team, 2008-2021
+# (C) Pywikibot team, 2008-2022
#
# Distributed under the terms of the MIT license.
#
@@ -238,7 +238,7 @@
"""Structure to hold values where the key is given by the value itself.
A structure like a defaultdict but the key is given by the value
- itselfvand cannot be assigned directly. It returns the number of all
+ itself and cannot be assigned directly. It returns the number of all
items with len() but not the number of keys.
Samples:
diff --git a/scripts/interwiki.py b/scripts/interwiki.py
index 1f222fe..47c6d6e 100755
--- a/scripts/interwiki.py
+++ b/scripts/interwiki.py
@@ -545,8 +545,8 @@
self.summary = value or pywikibot.input(
'What summary do you want to use?')
elif arg == 'lack':
- self.lacklanguage, sep, minlinks = value.partition(':')
- self.minlinks = int(minlinks) if minlinks.isdigit() else 1
+ self.lacklanguage, _, minlinks = value.partition(':')
+ self.minlinks = int(minlinks or 1)
elif arg in ('cleanup', 'confirm', 'force', 'hintnobracket',
'hintsareright', 'initialredirect', 'localonly', 'quiet',
'repository', 'same', 'select', 'skipauto',
@@ -559,36 +559,6 @@
return True
-class PageTree(SizedKeyCollection):
-
- """
- Structure to manipulate a set of pages.
-
- Allows filtering efficiently by Site.
- """
-
- def __init__(self):
- """Initializer.
-
- While using dict values would be faster for the remove() operation,
- keeping list values is important, because the order in which the pages
- were found matters: the earlier a page is found, the closer it is to
- the Subject.origin. Chances are that pages found within 2 interwiki
- distance from the origin are more related to the original topic
- than pages found later on, after 3, 4, 5 or more interwiki hops.
-
- Keeping this order is hence important to display an ordered
- list of pages to the user when he'll be asked to resolve
- conflicts.
-
- :ivar data: dictionary with Site as keys and list of page as values.
- All pages found within Site are kept in self.data[site].
-
- :type data: defaultdict(list)
- """
- super().__init__('site')
-
-
class Subject(interwiki_graph.Subject):
"""
@@ -667,16 +637,16 @@
self.repoPage = None
# todo is a list of all pages that still need to be analyzed.
# Mark the origin page as todo.
- self.todo = PageTree()
+ self.todo = SizedKeyCollection('site')
if origin:
self.todo.append(origin)
# done is a list of all pages that have been analyzed and that
# are known to belong to this subject.
- self.done = PageTree()
+ self.done = SizedKeyCollection('site')
# This is a list of all pages that are currently scheduled for
# download.
- self.pending = PageTree()
+ self.pending = SizedKeyCollection('site')
if self.conf.hintsareright:
# This is a set of sites that we got hints to
self.hintedsites = set()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/756119
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: I27b786642c525a12a6f6686d054a99283a2251c1
Gerrit-Change-Number: 756119
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/757695 )
Change subject: pwb.py: Fix some typos
......................................................................
pwb.py: Fix some typos
Change-Id: I467ddf685baa79983a0222e46222e4158c248756
---
M pwb.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pwb.py b/pwb.py
index be84c98..b5e54e5 100755
--- a/pwb.py
+++ b/pwb.py
@@ -13,7 +13,7 @@
5. Framework scripts residing in `pywikibot/scripts`.
This wrapper script is able to invoke scripts even the script name is
-missspelled. In directory mode it also checks package dependencies.
+misspelled. In directory mode it also checks package dependencies.
Run scripts with pywikibot in directory mode using::
@@ -26,7 +26,7 @@
This wrapper script uses the package directory to store all user files,
will fix up search paths so the package does not need to be installed, etc.
-Currently `<pwb options>` are :ref:`global options`. This can be used
+Currently, `<pwb options>` are :ref:`global options`. This can be used
for tests to set the default site (see T216825)::
python pwb.py -lang:de bot_tests -v
@@ -66,7 +66,7 @@
Rules:
- Pywikibot version must not be older than scrips version
- - Scripts version must not be older than previous Pyvikibot version
+ - Scripts version must not be older than previous Pywikibot version
due to deprecation policy
"""
from pywikibot.tools import Version
@@ -206,7 +206,7 @@
def check_modules(script=None):
"""Check whether mandatory modules are present.
- This also checks Python version when importing deptendencies from setup.py
+ This also checks Python version when importing dependencies from setup.py
:param script: The script name to be checked for dependencies
:type script: str or None
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/757695
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: I467ddf685baa79983a0222e46222e4158c248756
Gerrit-Change-Number: 757695
Gerrit-PatchSet: 2
Gerrit-Owner: 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/i18n/+/757642 )
Change subject: Localisation updates from https://translatewiki.net.
......................................................................
Localisation updates from https://translatewiki.net.
Change-Id: Ic4d2b40e3855eecd14ee9fd4b478f892e8964d08
---
M pywikibot/sd.json
M unprotect/fa.json
2 files changed, 3 insertions(+), 2 deletions(-)
Approvals:
L10n-bot: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/sd.json b/pywikibot/sd.json
index 082dc12..08c8820 100644
--- a/pywikibot/sd.json
+++ b/pywikibot/sd.json
@@ -4,7 +4,7 @@
"Mehtab ahmed"
]
},
- "pywikibot-cosmetic-changes": "ڪاسميٽڪ تبديليون",
+ "pywikibot-cosmetic-changes": "؛ ڪاسميٽڪ تبديليون",
"pywikibot-enter-category-name": "براءِ مهرباني زمري جو نالو داخل ڪريو:",
"pywikibot-enter-new-text": "نئون متن داخل ڪريو:"
}
diff --git a/unprotect/fa.json b/unprotect/fa.json
index d8b9d46..3775220 100644
--- a/unprotect/fa.json
+++ b/unprotect/fa.json
@@ -1,11 +1,12 @@
{
"@metadata": {
"authors": [
+ "Huji",
"Reza1615"
]
},
"unprotect-category": "ربات:خارج کردن حفاظت تمام صفحههای رده %(cat)s",
- "unprotect-images": "ربات: خارج کردن از محفاظت تمام تصاویر به کار رفته در %(page)s",
+ "unprotect-images": "ربات: خارج کردن از محافظت تمام پروندههای به کار رفته در %(page)s",
"unprotect-links": "ربات:خارج کردن از حفاظت تمام صفحههایی که در %(page)s پیوند شدهاند.",
"unprotect-ref": "ربات:خارج کردن از حفاظت تمام صفحههایی که به %(page)s پیوند دادهاند",
"unprotect-simple": "ربات:خارج کردن از محافظت فهرستی از صفحات"
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/757642
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/i18n
Gerrit-Branch: master
Gerrit-Change-Id: Ic4d2b40e3855eecd14ee9fd4b478f892e8964d08
Gerrit-Change-Number: 757642
Gerrit-PatchSet: 1
Gerrit-Owner: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: L10n-bot <l10n-bot(a)translatewiki.net>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged