jenkins-bot has submitted this change and it was merged.
Change subject: exec(line) of other packages is unexpected...
......................................................................
exec(line) of other packages is unexpected...
Change-Id: I9b4b9334c5af52cd2cf869b6aac9a62c66578013
---
M pywikibot/version.py
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 723a221..7f06fa1 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -274,7 +274,10 @@
with codecs.open(fn, 'r', "utf-8") as f:
for line in f.readlines():
if line.find('__version__') == 0:
- exec(line)
+ try:
+ exec(line)
+ except:
+ pass
break
stat = os.stat(fn)
mtime = datetime.datetime.fromtimestamp(stat.st_mtime).isoformat(' ')
--
To view, visit https://gerrit.wikimedia.org/r/192066
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9b4b9334c5af52cd2cf869b6aac9a62c66578013
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Eranroz <eranroz89(a)gmail.com>
Gerrit-Reviewer: Eranroz <eranroz89(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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] ItemPage: Avoid changing dict in toJSON
......................................................................
[FIX] ItemPage: Avoid changing dict in toJSON
In toJSON it changed the claims dict while iterating over it. As with
Python 3 the iterator is just a view to the current state and thus this
is not allowed.
Change-Id: Ib6dd67f8afdc90c576b2d433b24059f339ae84fa
---
M pywikibot/page.py
1 file changed, 4 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
Ricordisamoa: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 5607ace..e99694e 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -3519,12 +3519,10 @@
for dbName in sitelinks:
sitelinks[dbName] = {'site': dbName, 'title': sitelinks[dbName]}
- claims = self.claims.copy()
- for prop in claims.keys():
- if len(claims[prop]) > 0:
- claims[prop] = [claim.toJSON() for claim in claims[prop]]
- else:
- del claims[prop]
+ claims = {}
+ for prop in self.claims:
+ if len(self.claims[prop]) > 0:
+ claims[prop] = [claim.toJSON() for claim in self.claims[prop]]
if diffto and 'claims' in diffto:
temp = {}
--
To view, visit https://gerrit.wikimedia.org/r/198569
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6dd67f8afdc90c576b2d433b24059f339ae84fa
Gerrit-PatchSet: 1
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: Ricordisamoa <ricordisamoa(a)openmailbox.org>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] api: Use query module explicitly
......................................................................
[IMPROV] api: Use query module explicitly
When there is a query module and action module with the same name the
ParamInfo module is with a4951559 able to differentiate between both.
With this change ParamInfo chooses the action module if the query module
wasn't chosen explicitly using the module path instead of module name.
To avoid future problems with ambiguous names this patch is explicitly
using the full module path. So this will make it easier to deprecate the
implicit query module selection.
Change-Id: I9e7f8d15d2b469c312c599437b1d44509e9281a7
---
M pywikibot/data/api.py
M tests/api_tests.py
2 files changed, 8 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
XZise: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 9a9c030..9bd5c7d 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1785,8 +1785,8 @@
# Default values will only cause more requests and make the query
# slower.
for module in limited_modules:
- param = self.site._paraminfo.parameter(module, 'limit')
- prefix = self.site._paraminfo[module]['prefix']
+ param = self.site._paraminfo.parameter('query+' + module, 'limit')
+ prefix = self.site._paraminfo['query+' + module]['prefix']
if self.site.logged_in() and self.site.has_right('apihighlimits'):
self.request[prefix + 'limit'] = int(param['highmax'])
else:
@@ -1795,7 +1795,7 @@
self.api_limit = None
if self.limited_module:
- self.prefix = self.site._paraminfo[self.limited_module]['prefix']
+ self.prefix = self.site._paraminfo['query+' + self.limited_module]['prefix']
self._update_limit()
if self.api_limit is not None and "generator" in kwargs:
@@ -1852,7 +1852,8 @@
def _update_limit(self):
"""Set query limit for self.module based on api response."""
- param = self.site._paraminfo.parameter(self.limited_module, 'limit')
+ param = self.site._paraminfo.parameter('query+' + self.limited_module,
+ 'limit')
if self.site.logged_in() and self.site.has_right('apihighlimits'):
self.api_limit = int(param["highmax"])
else:
@@ -1876,7 +1877,8 @@
if the API module does not support multiple namespaces
"""
assert(self.limited_module) # some modules do not have a prefix
- param = self.site._paraminfo.parameter(self.limited_module, 'namespace')
+ param = self.site._paraminfo.parameter('query+' + self.limited_module,
+ 'namespace')
if not param:
pywikibot.warning(u'{0} module does not support a namespace '
'parameter'.format(self.limited_module))
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 8a495fc..af16ba0 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -554,7 +554,7 @@
"""Set up test case."""
super(TestDryListGenerator, self).setUp()
mysite = self.get_site()
- mysite._paraminfo['allpages'] = {
+ mysite._paraminfo['query+allpages'] = {
'prefix': 'ap',
'limit': {'max': 10},
'namespace': {'multi': True}
--
To view, visit https://gerrit.wikimedia.org/r/198252
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9e7f8d15d2b469c312c599437b1d44509e9281a7
Gerrit-PatchSet: 5
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: listpages: report number of pages found
......................................................................
listpages: report number of pages found
Bug: T93474
Change-Id: If80c25d3b69a2786d29d5dc4bf21783cd22d9e35
---
M scripts/listpages.py
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
XZise: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/listpages.py b/scripts/listpages.py
index 72cfcb5..55da78b 100644
--- a/scripts/listpages.py
+++ b/scripts/listpages.py
@@ -213,6 +213,7 @@
gen = genFactory.getCombinedGenerator()
if gen:
+ i = 0
for i, page in enumerate(gen, start=1):
if not notitle:
page_fmt = Formatter(page, outputlang)
@@ -227,6 +228,7 @@
pywikibot.output(u'Saving %s to %s' % (page.title(), filename))
with open(filename, mode='wb') as f:
f.write(page.text.encode(encoding))
+ pywikibot.output(u"%i page(s) found" % i)
else:
pywikibot.showHelp()
--
To view, visit https://gerrit.wikimedia.org/r/198515
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If80c25d3b69a2786d29d5dc4bf21783cd22d9e35
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2063
Status: Passed
Duration: 49 minutes and 26 seconds
Commit: 406da6b (master)
Author: Fabian Neundorf
Message: [FIX] React correctly to dynamic tokens
With d4e6e60c the tokens are loaded dynamically and that means that
certain tokens are now not validated anymore. It also removes one usage
of action+ prefix.
Change-Id: If95709f49d7d1da68e37ee89857e331bb6193ad8
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/d3cee5f25190...406da6ba…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/55174410
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] React correctly to dynamic tokens
......................................................................
[FIX] React correctly to dynamic tokens
With d4e6e60c the tokens are loaded dynamically and that means that
certain tokens are now not validated anymore. It also removes one usage
of action+ prefix.
Change-Id: If95709f49d7d1da68e37ee89857e331bb6193ad8
---
M pywikibot/site.py
M tests/site_tests.py
2 files changed, 11 insertions(+), 6 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index fdecbe0..457a917 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -2713,7 +2713,7 @@
else:
if _version < MediaWikiVersion('1.24wmf19'):
if all is not False:
- types_wiki = self._paraminfo.parameter('action+tokens',
+ types_wiki = self._paraminfo.parameter('tokens',
'type')['type']
types.extend(types_wiki)
req = api.Request(site=self, action='tokens',
diff --git a/tests/site_tests.py b/tests/site_tests.py
index 762f91f..322f1ef 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -1469,11 +1469,16 @@
try:
token = self.mysite.tokens[ttype]
except pywikibot.Error as error_msg:
- self.assertRegex(
- unicode(error_msg),
- "Action '[a-z]+' is not allowed for user .* on .* wiki.")
- # test __contains__
- self.assertNotIn(tokentype[0], self.mysite.tokens)
+ if tokentype:
+ self.assertRegex(
+ unicode(error_msg),
+ "Action '[a-z]+' is not allowed for user .* on .* wiki.")
+ # test __contains__
+ self.assertNotIn(tokentype[0], self.mysite.tokens)
+ else:
+ self.assertRegex(
+ unicode(error_msg),
+ "Requested token '[a-z]+' is invalid on .* wiki.")
else:
self.assertIsInstance(token, basestring)
self.assertEqual(token, self.mysite.tokens[ttype])
--
To view, visit https://gerrit.wikimedia.org/r/198219
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If95709f49d7d1da68e37ee89857e331bb6193ad8
Gerrit-PatchSet: 1
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: jenkins-bot <>