XZise has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197056
Change subject: [FIX] category: Apply namespace to tidy action
......................................................................
[FIX] category: Apply namespace to tidy action
The tidy action of the category script could apply the selected
namespaces.
Bug: T86351
Change-Id: I134ef38dcc1b6a010624ebe8039c339157de4ea0
---
M scripts/category.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/56/197056/1
diff --git a/scripts/category.py b/scripts/category.py
index 8a9d8cf..52d5043 100755
--- a/scripts/category.py
+++ b/scripts/category.py
@@ -807,7 +807,7 @@
"""
- def __init__(self, catTitle, catDB):
+ def __init__(self, catTitle, catDB, namespaces=None):
"""Constructor."""
self.catTitle = catTitle
self.catDB = catDB
@@ -818,7 +818,7 @@
self.cat = pywikibot.Category(site, catTitle)
super(CategoryTidyRobot, self).__init__(
generator=pagegenerators.PreloadingGenerator(
- self.cat.articles()))
+ self.cat.articles(namespaces=namespaces)))
def move_to_category(self, article, original_cat, current_cat):
"""
@@ -1203,7 +1203,7 @@
move_together=move_together)
elif action == 'tidy':
catTitle = pywikibot.input(u'Which category do you want to tidy up?')
- bot = CategoryTidyRobot(catTitle, catDB)
+ bot = CategoryTidyRobot(catTitle, catDB, genFactory.namespaces)
elif action == 'tree':
catTitle = pywikibot.input(
u'For which category do you want to create a tree view?')
--
To view, visit https://gerrit.wikimedia.org/r/197056
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I134ef38dcc1b6a010624ebe8039c339157de4ea0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits