jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1309764?usp=email )
Change subject: aspects: Fix mistakes in documentation and log messages
......................................................................
aspects: Fix mistakes in documentation and log messages
Change-Id: Ic3b913ea705b44112fa7020ec4199c2a1f1ac3a7
---
M tests/aspects.py
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/tests/aspects.py b/tests/aspects.py
index 762e042..1649627 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -769,7 +769,7 @@
The `skip_if_login_fails` parameter.
:param skip_if_login_fails: called with setUp(); if True, skip
- the current current test.
+ the current test.
"""
for site in self.sites.values():
site = site['site']
@@ -926,7 +926,7 @@
for hostname in hostnames:
if hostname in dct['sites']: # pragma: no cover
raise AttributeError(f'hostname {hostname!r} already found'
- f"in dict['sites']:\n{dict['sites']}")
+ f"in dct['sites']:\n{dct['sites']}")
dct['sites'][hostname] = {'hostname': hostname}
if dct.get('dry') is True:
@@ -1457,7 +1457,7 @@
if str(cls.get_repo()) != 'wikidata:wikidata':
raise unittest.SkipTest(f'{cls.__name__}: {cls.get_site()} is not'
- 'connected to Wikidata.')
+ ' connected to Wikidata.')
class PwbTestCase(TestCase):
@@ -1475,7 +1475,7 @@
unlikely scenario that the test case uses pwb in a way that doesn't
use a site.
- If a test class is marked as :code:`site = False , the metaclass
+ If a test class is marked as :code:`site = False`, the metaclass
will also check that the ``net`` flag is explicitly set.
"""
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1309764?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ic3b913ea705b44112fa7020ec4199c2a1f1ac3a7
Gerrit-Change-Number: 1309764
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307603?usp=email )
Change subject: Deprecate Family.post_get_convert and Family.pre_put_convert functions
......................................................................
Deprecate Family.post_get_convert and Family.pre_put_convert functions
Bug: T431188
Change-Id: Ic900afe7bdab346976d513a86f25a489b2db7251
Signed-off-by: Xqt <info(a)gno.de>
---
M pywikibot/family.py
1 file changed, 6 insertions(+), 0 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/pywikibot/family.py b/pywikibot/family.py
index 8c61f28..4a7e791 100644
--- a/pywikibot/family.py
+++ b/pywikibot/family.py
@@ -700,19 +700,25 @@
"""
return True
+ @deprecated(since='11.5.0')
def post_get_convert(self, site, getText):
"""Do a conversion on the retrieved text from the Wiki.
For example a :wiki:`X-conversion in Esperanto
<Esperanto_orthography#X-system>`.
+
+ .. version-deprecated:: 11.5
"""
return getText
+ @deprecated(since='11.5.0')
def pre_put_convert(self, site, putText):
"""Do a conversion on the text to insert on the Wiki.
For example a :wiki:`X-conversion in Esperanto
<Esperanto_orthography#X-system>`.
+
+ .. version-deprecated:: 11.5
"""
return putText
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307603?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ic900afe7bdab346976d513a86f25a489b2db7251
Gerrit-Change-Number: 1307603
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307532?usp=email )
Change subject: tests: Skip non-callable test attributes in MetaTestCaseClass
......................................................................
tests: Skip non-callable test attributes in MetaTestCaseClass
Only callable attributes should be treated as test methods. This
prevents an AttributeError when a test class defines a non-callable
attribute whose name starts with 'test'.
Bug: T85660
Change-Id: I95f608ec36418275a37fe6a75846e2efb6be29fc
---
M tests/aspects.py
1 file changed, 5 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/aspects.py b/tests/aspects.py
index 3c23365..762e042 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -865,9 +865,11 @@
return wrapped_method
- tests = [attr_name
- for attr_name in dct
- if attr_name.startswith('test')]
+ tests = [
+ attr_name
+ for attr_name, attr in dct.items()
+ if attr_name.startswith('test') and callable(attr)
+ ]
base_tests = []
if not tests:
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1307532?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I95f608ec36418275a37fe6a75846e2efb6be29fc
Gerrit-Change-Number: 1307532
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Meno25 has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1309639?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Update removed_wikis table in wikiquote family
......................................................................
Update removed_wikis table in wikiquote family
'wq' wiki is listed at
https://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implement…
but neither within closed_wikis, removed_wikis nor codes.
The wiki does not exists; therefore add it to the removed_wikis table.
Change-Id: I7a3ed82b79c9d281514373b9ac6d6c6ea05c0605
Signed-off-by: Xqt <info(a)gno.de>
---
M pywikibot/families/wikiquote_family.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
Meno25: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/families/wikiquote_family.py b/pywikibot/families/wikiquote_family.py
index fe3f871..2aca53f 100644
--- a/pywikibot/families/wikiquote_family.py
+++ b/pywikibot/families/wikiquote_family.py
@@ -25,7 +25,9 @@
removed_wikis = [
# https://noc.wikimedia.org/conf/highlight.php?file=dblists/deleted.dblist
- 'als', 'tokipona',
+ # wqwikiquote does not exist but is listed at
+ # https://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implement…
+ 'als', 'tokipona', 'wq',
]
codes = {
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1309639?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7a3ed82b79c9d281514373b9ac6d6c6ea05c0605
Gerrit-Change-Number: 1309639
Gerrit-PatchSet: 4
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Meno25 <meno25mail(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1308558?usp=email )
Change subject: [bugfix] Fix -tofile argument in listpages.py
......................................................................
[bugfix] Fix -tofile argument in listpages.py
The -tofile option was documented and used internally by the bot
class (self.opt.tofile), but had two bugs preventing it from working:
* The command-line argument parser never added -tofile to its list
of recognized options, causing it to be rejected as an unknown
parameter.
* When preloading is False and -put is not given, each processed
page's formatted output was immediately popped from output_list
and printed to stdout, leaving output_list empty by the time
teardown() tried to write it to the file specified by -tofile.
Both are fixed: -tofile is now recognized as a valid argument, and
the immediate print/pop behavior is skipped when -tofile is set, so
output_list retains its contents for teardown() to write out.
Bug: T431418
Change-Id: I92f4f1dc06c0b92e81973860fe53fb63657bbf28
---
M scripts/listpages.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
Ivan-r: Looks good to me, but someone else must approve
diff --git a/scripts/listpages.py b/scripts/listpages.py
index 3706506..db99040 100755
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -220,7 +220,7 @@
f.write(page.text.encode(self.opt.encode))
self.counter['save'] += 1
- if self.opt.preloading is False:
+ if self.opt.preloading is False and not self.opt.tofile:
pywikibot.stdout(self.output_list[-1]
if self.opt.put else self.output_list.pop())
@@ -294,7 +294,7 @@
if not value.strip():
options['notitle'] = True
options['format'] = value
- elif option in ('-encode', '-outputlang', '-save', '-summary'):
+ elif option in ('-encode', '-outputlang', '-save', '-summary', '-tofile'):
options[opt] = value
elif option == '-put':
page_target = value
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1308558?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I92f4f1dc06c0b92e81973860fe53fb63657bbf28
Gerrit-Change-Number: 1308558
Gerrit-PatchSet: 1
Gerrit-Owner: Nihar_Chakravarti <niharchakravarti05(a)gmail.com>
Gerrit-Reviewer: Ivan-r <ivanrussian15(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot