jenkins-bot merged this change.

View Change

Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
[cleanup] Instantiate GeneratorFactory for commons site

Part 4 detached from I28d72f2

Change-Id: Idf3586d95c5aa3ddd9b6edad60a3f0b5d583a6f2
---
M scripts/imagerecat.py
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/scripts/imagerecat.py b/scripts/imagerecat.py
index d4db6aa..9df03e0 100755
--- a/scripts/imagerecat.py
+++ b/scripts/imagerecat.py
@@ -200,7 +200,8 @@

# Process global args and prepare generator args parser
local_args = pywikibot.handle_args(args)
- genFactory = pagegenerators.GeneratorFactory()
+ site = pywikibot.Site('commons', 'commons')
+ genFactory = pagegenerators.GeneratorFactory(site=site)

for arg in local_args:
if arg == '-onlyuncat':
@@ -210,10 +211,8 @@

generator = genFactory.getCombinedGenerator()
if not generator:
- site = pywikibot.Site('commons', 'commons')
generator = pagegenerators.CategorizedPageGenerator(
- pywikibot.Category(site, 'Category:Media needing categories'),
- recurse=True)
+ pywikibot.Category(site, 'Media needing categories'), recurse=True)

initLists()
categorizeImages(generator, onlyUncat)

To view, visit change 553844. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idf3586d95c5aa3ddd9b6edad60a3f0b5d583a6f2
Gerrit-Change-Number: 553844
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: jenkins-bot (75)