jenkins-bot has submitted this change and it was merged.
Change subject: Add patrol to site.py
......................................................................
Add patrol to site.py
Add API: patrol to site.py
Change-Id: Id8262d765f7a7bbb398ce8c125d2358a8ca178fc
---
M pywikibot/site.py
M tests/site_tests.py
2 files changed, 125 insertions(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 82a7299..d4fe555 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -57,8 +57,11 @@
from urllib.parse import urlencode
basestring = (str,)
unicode = str
+ from itertools import zip_longest
else:
from urllib import urlencode
+ from itertools import izip_longest as zip_longest
+
_logger = "wiki.site"
@@ -4084,7 +4087,100 @@
# TODO: implement undelete
- # TODO: implement patrol
+ _patrol_errors = {
+ "nosuchrcid": "There is no change with rcid %(rcid)s",
+ "nosuchrevid": "There is no change with revid %(revid)s",
+ "patroldisabled": "Patrolling is disabled on %(site)s wiki",
+ "noautopatrol": "User %(user)s has no permission to patrol its own changes, 'autopatrol' is needed",
+ "notpatrollable": "The revision %(revid)s can't be patrolled as it's too old."
+ }
+
+ # test it with:
+ # python -m unittest tests.site_tests.SiteUserTestCase.testPatrol
+
+ def patrol(self, rcid=None, revid=None, revision=None):
+ """Return a generator of patrolled pages.
+
+ Pages to be patrolled are identified by rcid, revid or revision.
+ At least one of the parameters is mandatory.
+ See https://www.mediawiki.org/wiki/API:Patrol.
+
+ @param rcid: an int/string/iterable/iterator providing rcid of pages
+ to be patrolled.
+ @type rcid: iterable/iterator which returns a number or string which
+ contains only digits; it also supports a string (as above) or int
+ @param revid: an int/string/iterable/iterator providing revid of pages
+ to be patrolled.
+ @type revid: iterable/iterator which returns a number or string which
+ contains only digits; it also supports a string (as above) or int.
+ @param revision: an Revision/iterable/iterator providing Revision object
+ of pages to be patrolled.
+ @type revision: iterable/iterator which returns a Revision object; it
+ also supports a single Revision.
+ @yield: dict with 'rcid', 'ns' and 'title' of the patrolled page.
+
+ """
+
+ # If patrol is not enabled, attr will be set the first time a
+ # request is done.
+ if hasattr(self, u'_patroldisabled'):
+ if self._patroldisabled:
+ return
+
+ if all(_ is None for _ in [rcid, revid, revision]):
+ raise Error('No rcid, revid or revision provided.')
+
+ if isinstance(rcid, int) or isinstance(rcid, basestring):
+ rcid = set([rcid])
+ if isinstance(revid, int) or isinstance(revid, basestring):
+ revid = set([revid])
+ if isinstance(revision, pywikibot.page.Revision):
+ revision = set([revision])
+
+ # Handle param=None.
+ rcid = rcid or set()
+ revid = revid or set()
+ revision = revision or set()
+
+ # TODO: remove exeception for mw < 1.22
+ if (revid or revision) and LV(self.version()) < LV("1.22"):
+ raise NotImplementedError(
+ u'Support of "revid" parameter\n'
+ u'is not implemented in MediaWiki version < "1.22"')
+ else:
+ combined_revid = set(revid) | set(r.revid for r in revision)
+
+ gen = itertools.chain(
+ zip_longest(rcid, [], fillvalue='rcid'),
+ zip_longest(combined_revid, [], fillvalue='revid'))
+
+ token = self.tokens['patrol']
+
+ for idvalue, idtype in gen:
+ req = api.Request(site=self, action='patrol',
+ token=token, **{idtype: idvalue})
+
+ try:
+ result = req.submit()
+ except api.APIError as err:
+ # patrol is disabled, store in attr to avoid other requests
+ if err.code == u'patroldisabled':
+ self._patroldisabled = True
+ return
+
+ errdata = {
+ 'site': self,
+ 'user': self.user(),
+ }
+ errdata[idtype] = idvalue
+ if err.code in self._patrol_errors:
+ raise Error(self._patrol_errors[err.code] % errdata)
+ pywikibot.debug(u"protect: Unexpected error code '%s' received."
+ % err.code,
+ _logger)
+ raise
+
+ yield result['patrol']
@must_be(group='sysop')
def blockuser(self, user, expiry, reason, anononly=True, nocreate=True,
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 6b8295f..fca7262 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -15,6 +15,7 @@
import re
import pywikibot
+from pywikibot.data import api
from tests.aspects import (
unittest, TestCase,
DefaultSiteTestCase,
@@ -1032,6 +1033,33 @@
self.assertTrue(user["name"]
in ["Jimbo Wales", "Brion VIBBER", "Tim Starling"])
+ def testPatrol(self):
+ """Test the site.patrol() method."""
+ mysite = self.get_site()
+
+ rc = list(mysite.recentchanges(total=1))[0]
+
+ # site.patrol() needs params
+ self.assertRaises(pywikibot.Error, lambda x: list(x), mysite.patrol())
+ result = list(mysite.patrol(rcid=rc['rcid']))
+
+ if hasattr(mysite, u'_patroldisabled') and mysite._patroldisabled:
+ raise unittest.SkipTest(u'Patrolling is disabled on %s wiki.'
+ % mysite)
+
+ result = result[0]
+ self.assertIsInstance(result, dict)
+
+ try:
+ # no such rcid, revid or too old revid
+ result = list(mysite.patrol(rcid=0, revid=[0, 1]))
+ except api.APIError as error:
+ if error.code == u'badtoken':
+ raise unittest.SkipTest(error)
+ except pywikibot.Error as error:
+ #expected result
+ pass
+
class SiteRandomTestCase(DefaultSiteTestCase):
--
To view, visit https://gerrit.wikimedia.org/r/159197
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id8262d765f7a7bbb398ce8c125d2358a8ca178fc
Gerrit-PatchSet: 11
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Add soft dependency on httplib2 0.9.0 for cacerts
......................................................................
Add soft dependency on httplib2 0.9.0 for cacerts
Added the new version dependency only to setup.py
which ensures anyone packaging pywikibot provides
a version of httplib2 that has no known problems
with pywikibot.
Updated README for conversion:
- Remove mention of simplejson, as it is included
in all supported versions of python.
- Remove note about unsupported httplib2 0.4.0.
Bug: 65189
Change-Id: I1917c463256443262b723ca1dead50308c5b585e
---
M README-conversion.txt
M setup.py
2 files changed, 21 insertions(+), 11 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README-conversion.txt b/README-conversion.txt
index b137a28..dd6c1c7 100644
--- a/README-conversion.txt
+++ b/README-conversion.txt
@@ -48,18 +48,28 @@
so that these dependencies will be loaded automatically when the package is
installed, and users won't need to worry about this...]
-To run pywikibot, you will need the httplib2 and simplejson:
-packages--
-* httplib2 : https://github.com/jcgregorio/httplib2
-* simplejson : http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7.1/docs/index.html
+To run pywikibot, you will need the httplib2 package:
+* https://github.com/jcgregorio/httplib2
-or, if you already have setuptools installed, just execute
-'easy_install httplib2' and 'easy_install simplejson'
+It may be installed using pip or easy_install.
-If you run into errors involving httplib2.urlnorm, update httplib2 to 0.4.0
-(Ubuntu package python-httlib2, for example, is outdated). Note that
-httplib2 will run under Python 2.6, but will emit DeprecationWarnings (which
-are annoying but don't affect the ability to use the package).
+The minimum requirement is httplib2 0.6.0.
+However setup.py requires httplib2 0.9.0, as that version includes current
+root certificates needed to access Wikimedia servers using HTTPS.
+
+If your operating systems provides a packaged httplib2, it may be
+altered to load the root certificates from the host operating system.
+To check, execute:
+$ python -c 'import httplib2; print httplib2.CA_CERTS'
+
+httplib2 0.8.0 added the ability to define CA_CERTS with a plugin module.
+If you need to use 0.8.0, install module httplib2.ca_certs_locater with pip,
+and contribute fixes as necessary.
+https://pypi.python.org/pypi/httplib2.ca_certs_locater
+https://github.com/dreamhost/httplib2-ca_certs_locater
+
+If you use the pwb.py script, it will attempt to load httplib2 from the
+externals directory, which is a git submodule containing httplib2 0.9.0.
== Page objects ==
diff --git a/setup.py b/setup.py
index 86102fb..0947d97 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
test_deps = []
-dependencies = ['httplib2>=0.6.0']
+dependencies = ['httplib2>=0.9.0']
extra_deps = {}
--
To view, visit https://gerrit.wikimedia.org/r/138774
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1917c463256443262b723ca1dead50308c5b585e
Gerrit-PatchSet: 8
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipedia(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Use default site for API tests
......................................................................
Use default site for API tests
Change-Id: I446e0a807724bd63f78237ab867b670c9a8c951a
---
M tests/api_tests.py
1 file changed, 5 insertions(+), 9 deletions(-)
Approvals:
John Vandenberg: Looks good to me, but someone else must approve
Nullzero: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 3ff2cf6..a06e6fa 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -9,13 +9,11 @@
import datetime
import pywikibot
import pywikibot.data.api as api
-from tests.aspects import unittest, TestCase
+from tests.aspects import unittest, TestCase, DefaultSiteTestCase
-class TestApiFunctions(TestCase):
+class TestApiFunctions(DefaultSiteTestCase):
- family = 'wikipedia'
- code = 'en'
cached = True
def testObjectCreation(self):
@@ -119,25 +117,23 @@
self.assertEqual(len(results), 4) # total=-1 but 4 expected
-class TestCachedRequest(TestCase):
+class TestCachedRequest(DefaultSiteTestCase):
"""Test API Request caching.
This test class does not use the forced test caching.
"""
- family = 'wikipedia'
- code = 'en'
-
cached = False
def testResults(self):
mysite = self.get_site()
+ mainpage = self.get_mainpage()
# Run the cached query twice to ensure the
# data returned is equal
params = {'action': 'query',
'prop': 'info',
- 'titles': 'Main Page',
+ 'titles': mainpage.title(),
}
req = api.CachedRequest(datetime.timedelta(minutes=10),
site=mysite, **params)
--
To view, visit https://gerrit.wikimedia.org/r/160957
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I446e0a807724bd63f78237ab867b670c9a8c951a
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Nullzero <nullzero.free(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Improve timestripper to support more languages
......................................................................
Improve timestripper to support more languages
-Fixed regex of month digit from \d{1,2} to (?:1[012]|0?[1-9])
-Added sign of day, month and year for Korean
-Added a fixer to make non_latin_digits lation (languages like fa and ckb)
I tested it on three languages that are working now: ko, fa and ckb.
Change-Id: Iddbccc7cbcf16e77ca334d9a0d434f9e084884eb
---
M pywikibot/textlib.py
M tests/archivebot_tests.py
M tests/timestripper_tests.py
3 files changed, 32 insertions(+), 9 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9a2bd23..49bcf35 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -33,6 +33,15 @@
TEMP_REGEX = re.compile(
'{{(?:msg:)?(?P<name>[^{\|]+?)(?:\|(?P<params>[^{]+?(?:{[^{]+?}[^{]*?)?))?}}')
+NON_LATIN_DIGITS = [
+ u'٠١٢٣٤٥٦٧٨٩', # ckb
+ u'۰۱۲۳۴۵۶۷۸۹', # fa
+ u'೦೧೨೩೪೫೬೭೮೯', # kn
+ u'०१२३४५६७८९', # hi and some other
+ u'০১২৩৪৫৬৭৮৯', # bn
+ u'૦૧૨૩૪૫૬૭૮૯', # gu
+ u'୦୧୨୩୪୫୬୭୮୯', # or
+]
def unescape(s):
@@ -1198,8 +1207,7 @@
timeR = r'(?P<time>(?P<hour>([0-1]\d|2[0-3]))[:\.h](?P<minute>[0-5]\d))'
timeznR = r'\((?P<tzinfo>[A-Z]+)\)'
- yearR = r'(?P<year>(19|20)\d\d)'
-
+ yearR = r'(?P<year>(19|20)\d\d)(?:%s)?' % u'\ub144'
# if months have 'digits' as names, they need to be
# removed; will be handled as digits in regex, adding d+{1,2}\.?
escaped_months = [_ for _ in self.origNames2monthNum if
@@ -1207,13 +1215,14 @@
# match longest names first.
escaped_months = [re.escape(_) for
_ in sorted(escaped_months, reverse=True)]
-
# work around for cs wiki: if month are in digits, we assume
# that format is dd. mm. (with dot and spaces optional)
+ # the last one is workaround for Korean
if any(_.isdigit() for _ in self.origNames2monthNum):
self.is_digit_month = True
- monthR = r'(?P<month>(%s)|\d{1,2}\.?)' % u'|'.join(escaped_months)
- dayR = r'(?P<day>(3[01]|[12]\d|0?[1-9]))\.?\s*[01]?\d\.?'
+ monthR = r'(?P<month>(%s)(?:\u0654)?|(?:1[012]|0?[1-9])\.?(?:\uc6d4)?)' \
+ % u'|'.join(escaped_months)
+ dayR = r'(?P<day>(3[01]|[12]\d|0?[1-9]))(?:%s)?\.?\s*[01]?\d\.?' % u'\uc77c'
else:
self.is_digit_month = False
monthR = r'(?P<month>(%s))' % u'|'.join(escaped_months)
@@ -1222,7 +1231,7 @@
self.ptimeR = re.compile(timeR)
self.ptimeznR = re.compile(timeznR)
self.pyearR = re.compile(yearR)
- self.pmonthR = re.compile(monthR, re.U)
+ self.pmonthR = re.compile(monthR)
self.pdayR = re.compile(dayR)
# order is important to avoid mismatch when searching
@@ -1235,10 +1244,17 @@
]
def findmarker(self, text, base=u'@@', delta='@'):
- # find a string which is not part of text
+ """Find a string which is not part of text."""
while base in text:
base += delta
return base
+
+ def fix_digits(self, line):
+ """Make non-latin digits like Persian to latin to parse."""
+ for system in NON_LATIN_DIGITS:
+ for i in range(0, 10):
+ line = line.replace(system[i], str(i))
+ return line
def last_match_and_replace(self, txt, pat):
"""
@@ -1278,6 +1294,7 @@
"""
# match date fields
dateDict = dict()
+ line = self.fix_digits(line)
for pat in self.patterns:
line, matchDict = self.last_match_and_replace(line, pat)
if matchDict:
diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py
index 954c1b7..5c57d54 100644
--- a/tests/archivebot_tests.py
+++ b/tests/archivebot_tests.py
@@ -70,9 +70,9 @@
self.assertIsInstance(thread.content, basestring)
self.assertIsInstance(thread.timestamp, datetime)
- expected_failures = ['ar', 'ckb', 'fa', 'pdc', 'th']
+ expected_failures = ['ar', 'pdc', 'th']
# expected failures - should be fixed
- # 'ar', 'ckb', 'fa': no digits in date, regex does not match
+ # 'ar': Uses Arabic acronym for TZ
# 'pdc': changed month name setting in wiki over time (?)
# in old posts in talk page, February is "Feb.", site message gives
# <message name="feb" xml:space="preserve">Han.</message>.
diff --git a/tests/timestripper_tests.py b/tests/timestripper_tests.py
index d625c4b..0f265e3 100644
--- a/tests/timestripper_tests.py
+++ b/tests/timestripper_tests.py
@@ -139,6 +139,12 @@
'match': u'3 February 2010 19:48 (UTC) 7 February 2010 19:48 (UTC)',
'nomatch': u'3. 2. 2010, 19:48 (UTC) 7. 2. 2010 19:48 (UTC)',
},
+ 'fawiki': {
+ 'family': 'wikipedia',
+ 'code': 'fa',
+ 'match': u'۳ فوریهٔ ۲۰۱۰، ساعت ۱۹:۴۸ (UTC) ۷ فوریهٔ ۲۰۱۰، ساعت ۱۹:۴۸ (UTC)',
+ 'nomatch': u'۳ ۲ ۲۰۱۴ ۱۹:۴۸ (UTC) ۷ ۲ ۲۰۱۰ ۱۹:۴۸ (UTC)',
+ },
'frwiki': {
'family': 'wikipedia',
'code': 'fr',
--
To view, visit https://gerrit.wikimedia.org/r/161256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iddbccc7cbcf16e77ca334d9a0d434f9e084884eb
Gerrit-PatchSet: 9
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Revi <gerrit(a)revi.pe.kr>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] Only apply uppercase to Link title if namespace dictates so
......................................................................
[FIX] Only apply uppercase to Link title if namespace dictates so
The namespace defines if a Link title begins with an uppercase character.
The main namespace of Wiktionary, for example requires an exact match. As
the namespace always define the case, using the site case isn't necessary.
If the namespace doesn't report the case property it choses the site global
case property.
Bug: 69118 (partially)
Change-Id: If86346dc203c54d2e6631e3dddd106add3c34d30
---
M pywikibot/page.py
M tests/wikibase_tests.py
2 files changed, 8 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 13a5010..1096166 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -4118,7 +4118,12 @@
if self._namespace != -1 and len(t) > 255:
raise pywikibot.InvalidTitle("(over 255 bytes): '%s'" % t)
- if self._site.case() == 'first-letter':
+ if hasattr(self._site.namespaces()[self._namespace], 'case'):
+ case = self._site.namespaces()[self._namespace].case
+ else:
+ case = self._site.case()
+
+ if case == 'first-letter':
t = t[:1].upper() + t[1:]
# Can't make a link to a namespace alone...
diff --git a/tests/wikibase_tests.py b/tests/wikibase_tests.py
index 7726433..0231f55 100644
--- a/tests/wikibase_tests.py
+++ b/tests/wikibase_tests.py
@@ -732,9 +732,11 @@
class DrySite(pywikibot.site.DataSite):
_namespaces = {
90: Namespace(id=90,
+ case='first-letter',
canonical_name='Item',
defaultcontentmodel='wikibase-item'),
92: Namespace(id=92,
+ case='first-letter',
canonical_name='Prop',
defaultcontentmodel='wikibase-property')
}
--
To view, visit https://gerrit.wikimedia.org/r/161676
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If86346dc203c54d2e6631e3dddd106add3c34d30
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
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)
--
To view, visit https://gerrit.wikimedia.org/r/161674
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2498b1191148463d9ee5e093aa0ae8b1f12c45f0
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Multichill <maarten(a)mdammers.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>