jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/750728 )
Change subject: [fix] solve some deepsource bug issues
......................................................................
[fix] solve some deepsource bug issues
- use Site.title()with with_ns parameter instead of withNamespace
- use Thread.is_set instead of deprecated isSet method
Change-Id: Ic62bd4244eef6a55f2b96c2d79cb927df5053ba4
---
M pywikibot/tools/__init__.py
M scripts/commons_information.py
2 files changed, 3 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 981a488..ec381a2 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -634,7 +634,7 @@
def __iter__(self):
"""Iterate results from the queue."""
- if not self.is_alive() and not self.finished.isSet():
+ if not self.is_alive() and not self.finished.is_set():
self.start()
# if there is an item in the queue, yield it, otherwise wait
while not self.finished.is_set():
diff --git a/scripts/commons_information.py b/scripts/commons_information.py
index ac64b5b..616c704 100755
--- a/scripts/commons_information.py
+++ b/scripts/commons_information.py
@@ -74,8 +74,8 @@
'was found, but langdetect thinks {after!r} is the '
'most appropriate with a probability of {prob}:'
'\03{{default}}\n{text}'
- .format(before=tmp_page.title(withNamespace=False),
- after=tmp_page2.title(withNamespace=False),
+ .format(before=tmp_page.title(with_ns=False),
+ after=tmp_page2.title(with_ns=False),
prob=langs[0].prob,
text=lang_tmp_val))
choice = pywikibot.input_choice(
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/750728
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: Ic62bd4244eef6a55f2b96c2d79cb927df5053ba4
Gerrit-Change-Number: 750728
Gerrit-PatchSet: 1
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/+/750726 )
Change subject: [bugfix] Remove description parameter called with changeCommonscat
......................................................................
[bugfix] Remove description parameter called with changeCommonscat
The description parameter of changeCommonscat was never used and
removed recently. The method must not be called with it.
Change-Id: I3596c59987842710321776da39ec9d44c9391fc1
---
M scripts/commonscat.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 6d78923..6bb6c96 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -305,7 +305,7 @@
self.changeCommonscat(page, currentCommonscatTemplate,
currentCommonscatTarget,
primaryCommonscat,
- checkedCommonscatTarget, LinkText, Note)
+ checkedCommonscatTarget, LinkText)
return
# Commonscat link is wrong
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/750726
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: I3596c59987842710321776da39ec9d44c9391fc1
Gerrit-Change-Number: 750726
Gerrit-PatchSet: 1
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/+/750706 )
Change subject: [tests] Update l10n_tests.py
......................................................................
[tests] Update l10n_tests.py
- discard site tests because it does not care whether a site exists with
the given language code. Probably the language is used by incubator
- test the package anyway; add two keys for the tests.
Bug: T298388
Change-Id: Ib80b7b5a488498e9de3c9dcfbf51a8b3ab8db3ed
---
M tests/l10n_tests.py
1 file changed, 10 insertions(+), 15 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/l10n_tests.py b/tests/l10n_tests.py
index 820f5d6..04388de 100644
--- a/tests/l10n_tests.py
+++ b/tests/l10n_tests.py
@@ -6,6 +6,7 @@
#
import unittest
from contextlib import suppress
+from itertools import chain
import pywikibot
from pywikibot import i18n
@@ -98,26 +99,20 @@
.format(i18n._messages_package_name))
-class TestSites(TestCase):
+class TestPackages(TestCase):
"""Other test L10N cases processed by unittest."""
- family = 'wikipedia'
- code = 'en'
+ net = False
- def test_valid_sites(self):
- """Test whether language key has a corresponding site."""
- codes = self.site.family.languages_by_size
- languages = {pywikibot.Site(code, self.family).lang for code in codes}
- # langs used by foreign wikis
- languages.update(('pt-br', 'zh-tw'))
- for package in PACKAGES:
+ def test_valid_package(self):
+ """Test whether package has entries."""
+ for package in chain(['cosmetic_changes-standalone',
+ 'pywikibot-cosmetic-changes'], PACKAGES):
keys = i18n.twget_keys(package)
- for key in keys:
- with self.subTest(package=package, key=key):
- self.assertIn(key, languages,
- "json key '{}' is not a site language"
- .format(key))
+ with self.subTest(package=package):
+ self.assertIsNotEmpty(keys)
+ self.assertIn('en', keys)
if __name__ == '__main__': # pragma: no cover
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/750706
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: Ib80b7b5a488498e9de3c9dcfbf51a8b3ab8db3ed
Gerrit-Change-Number: 750706
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/+/750638 )
Change subject: [doc] fix documentation
......................................................................
[doc] fix documentation
Change-Id: I8e286b45e5e9a503860813e4b0540e229fff2336
---
M docs/api_ref/pywikibot.config.rst
M docs/installation.rst
M scripts/maintenance/make_i18n_dict.py
3 files changed, 9 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/docs/api_ref/pywikibot.config.rst b/docs/api_ref/pywikibot.config.rst
index c31852a..3e566c7 100644
--- a/docs/api_ref/pywikibot.config.rst
+++ b/docs/api_ref/pywikibot.config.rst
@@ -5,7 +5,6 @@
^^^^^^^^^^^^^
.. automodule:: pywikibot.config
- :noindex:
Option setting
^^^^^^^^^^^^^^
diff --git a/docs/installation.rst b/docs/installation.rst
index b943842..eda7c20 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -14,8 +14,9 @@
.. literalinclude:: ../user-config.py.sample
This sample is shipped with the repository but is not available with
-the site-package. For more settings use :mod:`generate_user_files` script
-or refer :mod:`pywikibot.config`.
+the site-package. For more settings use
+:mod:`generate_user_files<pywikibot.scripts.generate_user_files>` script
+or refer :py:mod:`pywikibot.config` module.
.. note::
Please also see the documentation at :manpage:`Installation`
diff --git a/scripts/maintenance/make_i18n_dict.py b/scripts/maintenance/make_i18n_dict.py
index c59d545..9fe0f56 100755
--- a/scripts/maintenance/make_i18n_dict.py
+++ b/scripts/maintenance/make_i18n_dict.py
@@ -3,24 +3,28 @@
Generate an i18n file from a given script.
run IDLE at topmost level:
+
>>> import pwb
>>> from scripts.maintenance.make_i18n_dict import i18nBot
>>> bot = i18nBot('<scriptname>', '<msg dict>')
>>> bot.run()
If you have more than one message dictionary, give all these names to the bot:
+
>>> bot = i18nBot('<scriptname>', '<msg dict1>', '<msg dict2>', '<msg dict3>')
If you want to rename the message index use keyword arguments. This may be
mixed with preleading positonal arguments:
+
>>> bot = i18nBot('<scriptname>', '<msg dict1>', the_other_msg='<msg dict2>')
If you have the messages as instance constants you may call the bot as follows:
->>> bot = i18nBot(
-... '<scriptname>.<class instance>', '<msg dict1>', '<msg dict2>')
+
+>>> bot = i18nBot('<scriptname>.<class name>', '<msg dict1>', '<msg dict2>')
It's also possible to make json files too by using to_json method after
instantiating the bot. It also calls ``bot.run()`` to create the dictionaries:
+
>>> bot.to_json()
"""
#
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/750638
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: I8e286b45e5e9a503860813e4b0540e229fff2336
Gerrit-Change-Number: 750638
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: Zabe <alexander.vorwerk(a)stud.uni-goettingen.de>
Gerrit-MessageType: merged