jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/553844 )
Change subject: [cleanup] Instantiate GeneratorFactory for commons site ......................................................................
[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(-)
Approvals: D3r1ck01: Looks good to me, approved jenkins-bot: Verified
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)
pywikibot-commits@lists.wikimedia.org