jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/654468 )

Change subject: [IMPR] Use pagegenerators -page option in redirect.py
......................................................................

[IMPR] Use pagegenerators -page option in redirect.py

Bug: T100643
Change-Id: I1723b7160924d82b0529b2346389cefebc4d7ef7
---
M scripts/redirect.py
1 file changed, 7 insertions(+), 12 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/redirect.py b/scripts/redirect.py
index ef04b64..1cf0da0 100755
--- a/scripts/redirect.py
+++ b/scripts/redirect.py
@@ -39,8 +39,6 @@
                If neither of -xml -fullscan -moves is given, info will be
                loaded from a special page of the live wiki.

--page:title    Work on a single page
-
 -offset:n      With -moves, the number of hours ago to start scanning moved
                pages. With -xml, the number of the redirect to restart with
                (see progress). Otherwise, ignored.
@@ -104,7 +102,6 @@
         'moves': False,
         'namespaces': {0},
         'offset': -1,
-        'page': None,
         'start': None,
         'limit': None,
         'until': None,
@@ -299,8 +296,6 @@
             for (key, value) in redirs.items():
                 if value not in pageTitles:
                     yield key
-        elif self.opt.page:
-            yield self.opt.page
         else:
             pywikibot.output('Retrieving broken redirect special page...')
             yield from self.site.preloadpages(self.site.broken_redirects())
@@ -330,8 +325,6 @@
                     pywikibot.output('\nChecking redirect {0} of {1}...'
                                      .format(num, total))
                     yield key
-        elif self.opt.page:
-            yield self.opt.page
         else:
             pywikibot.output('Retrieving double redirect special page...')
             yield from self.site.preloadpages(self.site.double_redirects())
@@ -693,7 +686,7 @@
             source.add(arg)
         elif option == 'offset':
             gen_options[option] = int(value)
-        elif option in ('page', 'start', 'until'):
+        elif option in ('start', 'until'):
             gen_options[option] = value
         elif option == 'limit':
             options['limit'] = gen_options['limit'] = int(value)
@@ -713,10 +706,12 @@
         pywikibot.bot.suggest_help(missing_action=True)
         return

-    if gen_factory.namespaces:
-        gen_options['namespaces'] = gen_factory.namespaces
-    gen = RedirectGenerator(action, **gen_options)
-    options['generator'] = gen_factory.getCombinedGenerator(gen)
+    gen = None
+    if not gen_factory.gens:
+        if gen_factory.namespaces:
+            gen_options['namespaces'] = gen_factory.namespaces
+        gen = RedirectGenerator(action, **gen_options)
+    options['generator'] = gen_factory.getCombinedGenerator(gen=gen)
     bot = RedirectRobot(action, **options)
     bot.run()


--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/654468
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1723b7160924d82b0529b2346389cefebc4d7ef7
Gerrit-Change-Number: 654468
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: MarcoAurelio <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to