jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/1024380?usp=email )
Change subject: Localisation updates from https://translatewiki.net.
......................................................................
Localisation updates from https://translatewiki.net.
Change-Id: Ic0117459816a81546dc2eaf32ff75c0673b1d14b
---
M checkimages/be-tarask.json
1 file changed, 3 insertions(+), 0 deletions(-)
Approvals:
L10n-bot: Looks good to me, approved
jenkins-bot: Verified
diff --git a/checkimages/be-tarask.json b/checkimages/be-tarask.json
index 48ad854..1379a9a 100644
--- a/checkimages/be-tarask.json
+++ b/checkimages/be-tarask.json
@@ -9,6 +9,9 @@
"checkimages-doubles-file-comment": "Робат: файл ужо ў Вікісховішчы, можа быць выдалены",
"checkimages-doubles-head": "Файл-дублікат",
"checkimages-doubles-talk-comment": "Робат: паведамленьне, што файл ужо існуе ў Вікісховішчы",
+ "checkimages-doubles-talk-text": "Дзякуем за загрузку %(upload)s. Аднак гэты файл ёсьць копіяй:%(image)sРобат пазначыў дублікатам файл, які менш выкарыстоўваецца ці найпазьнейшы. Калі ві лічыце, што слушней пакінуць файл, які пазначаны да хуткага выдаленьня, сьмела выдаляйце дублікаты файлаў і выдаляйце шаблёны выдаленьня з файлаў, якія варта пакінуць. Гэта аўтаматычнае паведамленьне ад %(bot)s.",
+ "checkimages-forced-mode": "('''прымусовы рэжым''')",
+ "checkimages-has-duplicates": "мае гэткія дублікаты%(force)s:",
"checkimages-log-comment": "Робат: абнаўленьне журналу",
"checkimages-no-license-head": "Выява безь ліцэнзіі",
"checkimages-source-tag-comment": "Робат: пазначаю новазагружаны неадзначаны файл",
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/1024380?usp=email
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: Ic0117459816a81546dc2eaf32ff75c0673b1d14b
Gerrit-Change-Number: 1024380
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
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023474?usp=email )
Change subject: [tests] Show user rights if UserRightsError is raised during tests
......................................................................
[tests] Show user rights if UserRightsError is raised during tests
Bug: T363190
Change-Id: Ic46e899e0fdc07ee34e1b2cd855e2fdd51835ead
---
M pywikibot/site/_decorators.py
M tests/site_decorators_tests.py
2 files changed, 48 insertions(+), 46 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site/_decorators.py b/pywikibot/site/_decorators.py
index 3656e4e..6539355 100644
--- a/pywikibot/site/_decorators.py
+++ b/pywikibot/site/_decorators.py
@@ -1,15 +1,23 @@
"""Decorators used by site models."""
#
-# (C) Pywikibot team, 2008-2023
+# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
#
from __future__ import annotations
+import os
+from textwrap import fill
+
from pywikibot.exceptions import UnknownExtensionError, UserRightsError
from pywikibot.tools import MediaWikiVersion, manage_wrapping
+CLOSED_WIKI_MSG = (
+ 'Site {site} has been closed. Only steward can perform requested action.'
+)
+
+
def must_be(group: str | None = None):
"""Decorator to require a certain user status when method is called.
@@ -24,15 +32,11 @@
grp = kwargs.pop('as_group', group)
if self.obsolete:
if not self.has_group('steward'):
- raise UserRightsError(
- 'Site {} has been closed. Only steward '
- 'can perform requested action.'
- .format(self.sitename))
+ raise UserRightsError(CLOSED_WIKI_MSG.format(site=self))
elif not self.has_group(grp):
- raise UserRightsError('User "{}" is not part of the required '
- 'user group "{}"'
- .format(self.user(), grp))
+ raise UserRightsError(f'User "{self.user()}" is not part of '
+ f'the required user group "{grp}"')
return fn(self, *args, **kwargs)
@@ -53,8 +57,8 @@
def callee(self, *args, **kwargs):
if not self.has_extension(extension):
raise UnknownExtensionError(
- 'Method "{}" is not implemented without the extension {}'
- .format(fn.__name__, extension))
+ f'Method "{fn.__name__}" is not implemented without the '
+ f'extension {extension}')
return fn(self, *args, **kwargs)
manage_wrapping(callee, fn)
@@ -74,15 +78,18 @@
def callee(self, *args, **kwargs):
if self.obsolete:
if not self.has_group('steward'):
- raise UserRightsError(
- 'Site {} has been closed. Only stewards '
- 'can perform the requested action.'
- .format(self.sitename))
+ raise UserRightsError(CLOSED_WIKI_MSG.format(site=self))
elif right is not None and not self.has_right(right):
- raise UserRightsError('User "{}" does not have required '
- 'user right "{}"'
- .format(self.user(), right))
+ if os.environ.get('PYWIKIBOT_TEST_RUNNING', '0') == '1':
+ rights = ' but:\n' + fill(
+ str(sorted(self.userinfo['rights'])),
+ width=76, break_on_hyphens=False)
+ else:
+ rights = '.'
+ raise UserRightsError(
+ f'User "{self.user()}" does not have required user right '
+ f'"{right}"{rights}')
return fn(self, *args, **kwargs)
manage_wrapping(callee, fn)
@@ -102,9 +109,8 @@
def callee(self, *args, **kwargs):
if MediaWikiVersion(self.version()) < MediaWikiVersion(version):
raise NotImplementedError(
- 'Method or function "{}"\n'
- "isn't implemented in MediaWiki version < {}"
- .format(fn.__name__, version))
+ f'Method or function "{fn.__name__}"\n'
+ f"isn't implemented in MediaWiki version < {version}")
return fn(self, *args, **kwargs)
manage_wrapping(callee, fn)
diff --git a/tests/site_decorators_tests.py b/tests/site_decorators_tests.py
index a1e3c71..8256132 100755
--- a/tests/site_decorators_tests.py
+++ b/tests/site_decorators_tests.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
"""Tests against a fake Site object."""
#
-# (C) Pywikibot team, 2012-2023
+# (C) Pywikibot team, 2012-2024
#
# Distributed under the terms of the MIT license.
#
@@ -15,9 +15,9 @@
from tests.aspects import DeprecationTestCase, TestCase
-class TestMustBe(TestCase):
+class DecoratorTestsBase(TestCase):
- """Test cases for the must_be decorator."""
+ """Base class for decorator tests."""
net = False
@@ -30,20 +30,29 @@
self.family.name = 'test'
self.sitename = self.family.name + ':' + self.code
self._logged_in_as = None
- self._userinfo = []
self.obsolete = False
super().setUp()
- self.version = lambda: '1.23' # lowest supported release
+ self.version = lambda: '1.27' # lowest supported release
+
+ def user(self):
+ """Fake the logged in user."""
+ return self._logged_in_as
+
+
+class TestMustBe(DecoratorTestsBase):
+
+ """Test cases for the must_be decorator."""
+
+ def setUp(self):
+ """Creating fake variables to appear as a site."""
+ self._userinfo = []
+ super().setUp()
def login(self, group):
"""Fake the log in as required user group."""
self._logged_in_as = group
self._userinfo = [group]
- def user(self):
- """Fake the logged in user."""
- return self._logged_in_as
-
def has_group(self, group):
"""Fake the groups user belongs to."""
return group in self._userinfo
@@ -127,38 +136,25 @@
self.call_this_user_req_function(args, kwargs)
-class TestNeedRight(TestCase):
+class TestNeedRight(DecoratorTestsBase):
"""Test cases for the must_be decorator."""
- net = False
-
# Implemented without setUpClass(cls) and global variables as objects
# were not completely disposed and recreated but retained 'memory'
def setUp(self):
"""Creating fake variables to appear as a site."""
- self.code = 'test'
- self.family = lambda: None
- self.family.name = 'test'
- self.sitename = self.family.name + ':' + self.code
- self._logged_in_as = None
- self._userinfo = []
- self.obsolete = False
+ self.userinfo = {'rights': []}
super().setUp()
- self.version = lambda: '1.23' # lowest supported release
def login(self, group, right):
"""Fake the log in as required user group."""
self._logged_in_as = group
- self._userinfo = [right]
-
- def user(self):
- """Fake the logged in user."""
- return self._logged_in_as
+ self.userinfo['rights'] = [right]
def has_right(self, right):
"""Fake the groups user belongs to."""
- return right in self._userinfo
+ return right in self.userinfo['rights']
@need_right('edit')
def call_this_edit_req_function(self, *args, **kwargs):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023474?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: Ic46e899e0fdc07ee34e1b2cd855e2fdd51835ead
Gerrit-Change-Number: 1023474
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1023107?usp=email )
Change subject: [bugfic] Fix wikibase_(edit_)tests
......................................................................
[bugfic] Fix wikibase_(edit_)tests
Bug: T363101
Change-Id: I3e50f7900e4f053f77ee85841efe8a8433c218d2
---
M tests/wikibase_edit_tests.py
M tests/wikibase_tests.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/wikibase_edit_tests.py b/tests/wikibase_edit_tests.py
index 307c4f5..d2e9fc5 100755
--- a/tests/wikibase_edit_tests.py
+++ b/tests/wikibase_edit_tests.py
@@ -421,7 +421,7 @@
# set new claim
claim = pywikibot.page.Claim(
testsite, 'P88936', datatype='musical-notation')
- target = "\relative c' { c d e f | g2 g | a4 a a a | g1 |})"
+ target = "\\relative c' { c d e f | g2 g | a4 a a a | g1 |}"
claim.setTarget(target)
item.addClaim(claim)
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index cea1677..033be36 100755
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -2014,7 +2014,7 @@
wikidata = self.get_repo()
claim = pywikibot.Claim(wikidata, 'P6604')
self.assertEqual(claim.type, 'musical-notation')
- target = "\relative c' { c d e f | g2 g | a4 a a a | g1 |})"
+ target = "\\relative c' { c d e f | g2 g | a4 a a a | g1 |}"
claim.setTarget(target)
self.assertEqual(claim.target, target)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023107?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: I3e50f7900e4f053f77ee85841efe8a8433c218d2
Gerrit-Change-Number: 1023107
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1023072?usp=email )
Change subject: Localisation updates from https://translatewiki.net.
......................................................................
Localisation updates from https://translatewiki.net.
Change-Id: Iff505ca3c991c318494a5cc4754cce3558fa8ae6
---
M protect/lb.json
M redirect/lb.json
M unprotect/lb.json
3 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
L10n-bot: Looks good to me, approved
jenkins-bot: Verified
diff --git a/protect/lb.json b/protect/lb.json
index 64eca27..871f518 100644
--- a/protect/lb.json
+++ b/protect/lb.json
@@ -7,6 +7,6 @@
"protect-category": "Bot: All Säiten aus der Kategorie %(cat)s spären",
"protect-images": "Bot: All Biller op der Säit %(page)s spären",
"protect-links": "Bot: All Säite spären déi vun der Säit %(page)s verlinkt sinn",
- "protect-ref": "Bot: All Säite spären, déi op d'Säit %(page)s linken",
+ "protect-ref": "Bot: All Säite spären, déi op d'Säit %(page)s referéieren",
"protect-simple": "Bot: Eng Lëscht vu Fichiere spären."
}
diff --git a/redirect/lb.json b/redirect/lb.json
index 233edaa..ec5f69e 100644
--- a/redirect/lb.json
+++ b/redirect/lb.json
@@ -9,7 +9,7 @@
"redirect-broken-redirect-template": "{{Läschen|1=Defekt Viruleedung}}",
"redirect-fix-broken-moved": "Futtis Viruleedung op déi geréckelt Zilsäit %(to)s gouf gefléckt",
"redirect-fix-double": "Duebel Viruleedung gefléckt → %(to)s",
- "redirect-fix-loop": "Viruleedungsschleef op %(to)s verbessert",
+ "redirect-fix-loop": "Verbesserung vun der Viruleedungsschleef op %(to)s",
"redirect-remove-broken": "Viruleedung op eng geläscht Säit oder eng Säit déi et net gëtt",
"redirect-remove-loop": "Viruleedung där hiert Zil zu enger endlos Schleef féiert"
}
diff --git a/unprotect/lb.json b/unprotect/lb.json
index feecdfd..19aee01 100644
--- a/unprotect/lb.json
+++ b/unprotect/lb.json
@@ -7,6 +7,6 @@
"unprotect-category": "Bot: D'Spär vun alle Säiten aus der Kategorie %(cat)s gouf opgehuewen",
"unprotect-images": "Bot: D'Spär fir all Biller op der Säit %(page)s ophiewen",
"unprotect-links": "Bot: D'Spär vun alle Säiten, déi vu(n) %(page)s verlinkt sinn, gouf opgehuewen",
- "unprotect-ref": "Bot: D'Spär vun alle Säite, déi op d'Säit %(page)s linken, gouf opgehuewen",
+ "unprotect-ref": "Bot: D'Spär vun alle Säite, déi op d'Säit %(page)s referéieren, gouf opgehuewen",
"unprotect-simple": "Bot: D'Spär fir eng Lëscht vu Fichiere ophiewen"
}
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/i18n/+/1023072?usp=email
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: Iff505ca3c991c318494a5cc4754cce3558fa8ae6
Gerrit-Change-Number: 1023072
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
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023059?usp=email )
Change subject: [doc] Do not show version hints with -help option in make_dist.py
......................................................................
[doc] Do not show version hints with -help option in make_dist.py
Change-Id: I5ba629de9535648430b156d8cd451bac092f13bf
---
M make_dist.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/make_dist.py b/make_dist.py
index 8dc2a13..8979c73 100755
--- a/make_dist.py
+++ b/make_dist.py
@@ -204,8 +204,11 @@
uploaded
"""
if '-help' in sys.argv:
+ import re
import setup
- info(__doc__)
+ help_text = re.sub(r'^\.\. version(added|changed)::.+', '',
+ __doc__, flags=re.MULTILINE | re.DOTALL)
+ info(help_text)
info(setup.__doc__)
sys.exit()
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023059?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: I5ba629de9535648430b156d8cd451bac092f13bf
Gerrit-Change-Number: 1023059
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
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/+/1023048?usp=email )
Change subject: [9.2] Prepare next release
......................................................................
[9.2] Prepare next release
Change-Id: I976f3464b606e3a9f8cbf54c613262667c07daeb
---
M .appveyor.yml
M HISTORY.rst
M ROADMAP.rst
M pywikibot/__metadata__.py
M scripts/__init__.py
5 files changed, 26 insertions(+), 19 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/.appveyor.yml b/.appveyor.yml
index 6fb8acf..96d787b 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -1,7 +1,7 @@
image: Visual Studio 2022
clone_depth: 50
skip_tags: true
-version: 9.1.{build}
+version: 9.2.{build}
environment:
PYWIKIBOT_DIR: "%appdata%\\Pywikibot"
diff --git a/HISTORY.rst b/HISTORY.rst
index 2104ff9..48d05a2 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,6 +1,28 @@
Release history
===============
+9.1.0
+-----
+*22 April 2024*
+
+* ``-usernames`` option was added to :mod:`version<pywikibot.scripts.version>` script
+* Circumvent problems with *unique* and *prefix* parameters in :meth:`Site.alllinks()
+ <pywikibot.site._generators.GeneratorsMixin.alllinks>` (:phab:`T359427`)
+* Detect nighly version file with :func:`version.getversion_nightly` (:phab:`T362492`)
+* :mod:`version`.github_svn_rev2hash() was removed; it was no longer functional (:phab:`T362484`)
+* SVN support has been dropped; ``.svnprops`` property settings was removed (:phab:`T362484`)
+* Skip process that requires login to logout (:phab:`T326614`)
+* File title of :class:`specialbots.UploadRobot` must have a valid file extension (:phab:`T345786`)
+* Add a :attr:`post_processor<specialbots.UploadRobot.post_processor>` attribute to :class:`specialbots.UploadRobot`
+ which can be called after each upload (:phab:`T359766`)
+* Avoid using :meth:`pywikibot.handle_args` in private scripts;
+ use :mod:`pwb<pywikibot.scripts.wrapper>` wrapper instead (:phab:`T359766`)
+* Show upload count with :class:`specialbots.UploadRobot`
+* Use the same ``iiprop`` properties in :class:`data.api.PageGenerator` as in
+ :meth:`APISite.loadimageinfo<pywikibot.site._apisite.APISite.loadimageinfo>` (:phab:`T360093`)
+* i18n updates
+
+
9.0.0
-----
*08 March 2024*
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 854f7bc..19cb97f 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,22 +1,7 @@
Current release
---------------
-* ``-usernames`` option was added to :mod:`version<pywikibot.scripts.version>` script
-* Circumvent problems with *unique* and *prefix* parameters in :meth:`Site.alllinks()
- <pywikibot.site._generators.GeneratorsMixin.alllinks>` (:phab:`T359427`)
-* Detect nighly version file with :func:`version.getversion_nightly` (:phab:`T362492`)
-* :mod:`version`.github_svn_rev2hash() was removed; it was no longer functional (:phab:`T362484`)
-* SVN support has been dropped; ``.svnprops`` property settings was removed (:phab:`T362484`)
-* Skip process that requires login to logout (:phab:`T326614`)
-* File title of :class:`specialbots.UploadRobot` must have a valid file extension (:phab:`T345786`)
-* Add a :attr:`post_processor<specialbots.UploadRobot.post_processor>` attribute to :class:`specialbots.UploadRobot`
- which can be called after each upload (:phab:`T359766`)
-* Avoid using :meth:`pywikibot.handle_args` in private scripts;
- use :mod:`pwb<pywikibot.scripts.wrapper>` wrapper instead (:phab:`T359766`)
-* Show upload count with :class:`specialbots.UploadRobot`
-* Use the same ``iiprop`` properties in :class:`data.api.PageGenerator` as in
- :meth:`APISite.loadimageinfo<pywikibot.site._apisite.APISite.loadimageinfo>` (:phab:`T360093`)
-* i18n updates
+* (no changes yet)
Deprecations
------------
diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py
index 0452c41..1a8c5de 100644
--- a/pywikibot/__metadata__.py
+++ b/pywikibot/__metadata__.py
@@ -12,6 +12,6 @@
from time import strftime
-__version__ = '9.1.0'
+__version__ = '9.2.0.dev0'
__url__ = 'https://www.mediawiki.org/wiki/Manual:Pywikibot'
__copyright__ = '(C) Pywikibot team, 2003-' + strftime('%Y')
diff --git a/scripts/__init__.py b/scripts/__init__.py
index d289690..01864c7 100644
--- a/scripts/__init__.py
+++ b/scripts/__init__.py
@@ -32,4 +32,4 @@
#
# Distributed under the terms of the MIT license.
#
-__version__ = '9.1.0'
+__version__ = '9.2.0'
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1023048?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: I976f3464b606e3a9f8cbf54c613262667c07daeb
Gerrit-Change-Number: 1023048
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