jenkins-bot has submitted this change and it was merged.
Change subject: Fix -cat pagegenerator
......................................................................
Fix -cat pagegenerator
-cat without an argument was broken in 343b875
This broken unit test test_pagegen_i18n_input
Also properly deprecated the old 'arg' argument for
public GeneratorFactory.getCategory and .getCategoryGen
which was also a breaking change in 343b875.
Bug: T129001
Change-Id: Ifca4c65737e1f67f14576f540bdafcd0b82daf4c
---
M pywikibot/pagegenerators.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py
index 2f80a3b..7c9854e 100644
--- a/pywikibot/pagegenerators.py
+++ b/pywikibot/pagegenerators.py
@@ -475,6 +475,7 @@
return dupfiltergen
+ @deprecated_args(arg='category')
def getCategory(self, category):
"""
Return Category and start as defined by category.
@@ -483,7 +484,7 @@
@type category: str
@rtype: tuple
"""
- if category.startswith('-'): # old arg parameter
+ if category and category.startswith('-'):
categoryname = category.partition(':')[2]
issue_deprecation_warning(
'The usage of "{0}" as actual parameter of '
@@ -491,6 +492,7 @@
categoryname, 2, ArgumentDeprecationWarning)
else:
categoryname = category
+
if not categoryname:
categoryname = i18n.input(
'pywikibot-enter-category-name',
@@ -512,6 +514,7 @@
defaultNamespace=14))
return cat, startfrom
+ @deprecated_args(arg='category')
def getCategoryGen(self, category, recurse=False, content=False,
gen_func=None):
"""
--
To view, visit
https://gerrit.wikimedia.org/r/275272
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifca4c65737e1f67f14576f540bdafcd0b82daf4c
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>