jenkins-bot has submitted this change and it was merged.
Change subject: (bug 71089): Add -mysqlquery commandline option to pagegenerators.py Now with documentation ......................................................................
(bug 71089): Add -mysqlquery commandline option to pagegenerators.py Now with documentation
Change-Id: I2498b1191148463d9ee5e093aa0ae8b1f12c45f0 --- M pywikibot/pagegenerators.py 1 file changed, 10 insertions(+), 0 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/pagegenerators.py b/pywikibot/pagegenerators.py index 0ba02b4..ab3644f 100644 --- a/pywikibot/pagegenerators.py +++ b/pywikibot/pagegenerators.py @@ -156,6 +156,10 @@ Argument can be given as "-withoutinterwiki:n" where n is some number (??).
+-mysqlquery Takes a Mysql query string like + "SELECT page_namespace, page_title, FROM page + WHERE page_namespace = 0" and works on the resulting pages. + -wikidataquery Takes a WikidataQuery query string like claim[31:12280] and works on the resulting pages.
@@ -538,6 +542,12 @@ query = pywikibot.input( u'WikidataQuery string:') gen = WikidataQueryPageGenerator(query) + elif arg.startswith('-mysqlquery'): + query = arg[len('-mysqlquery:'):] + if not query: + query = pywikibot.input( + u'Mysql query string:') + gen = MySQLPageGenerator(query)
if gen: self.gens.append(gen)
pywikibot-commits@lists.wikimedia.org