jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] CachedRequest: Cap expiry time by config
......................................................................
[IMPROV] CachedRequest: Cap expiry time by config
This prevents any caches longer than the configured time even if they
are using a higher number.
Change-Id: Iab9fa866fe1c235455d02095a83fb83fb40fbb07
---
M pywikibot/data/api.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 71cc0a9..70e512b 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1723,7 +1723,7 @@
super(CachedRequest, self).__init__(*args, **kwargs)
if not isinstance(expiry, datetime.timedelta):
expiry = datetime.timedelta(expiry)
- self.expiry = expiry
+ self.expiry = min(expiry, datetime.timedelta(config.API_config_expiry))
self._data = None
self._cachetime = None
--
To view, visit https://gerrit.wikimedia.org/r/200301
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iab9fa866fe1c235455d02095a83fb83fb40fbb07
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] tests: More information on intersect fail
......................................................................
[IMPROV] tests: More information on intersect fail
Instead of just comparing the lengths it should also tell which items
are missing/duplicates.
Change-Id: I2d8b60749f0c25b036139237effbc84d05d4d766
---
M tests/thread_tests.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
XZise: Looks good to me, but someone else must approve
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/thread_tests.py b/tests/thread_tests.py
index 79a67a4..581aab0 100644
--- a/tests/thread_tests.py
+++ b/tests/thread_tests.py
@@ -48,7 +48,7 @@
result = list(intersect_generators(datasets))
- self.assertEqual(len(set(result)), len(result))
+ self.assertCountEqual(set(result), result)
self.assertCountEqual(result, set_result)
--
To view, visit https://gerrit.wikimedia.org/r/200309
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2d8b60749f0c25b036139237effbc84d05d4d766
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: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #2076
Status: Failed
Duration: 43 minutes and 4 seconds
Commit: 4c1cbbf (master)
Author: Fabian Neundorf
Message: [FIX] Siteinfo: Correctly compare cache time
The expiry check worked backwards and didn't actually check if the
cached time was in the past (adding the expiry).
Bug: T94293
Change-Id: I7e43b0191b945c76dd19e30a560431bea928e4a0
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/b8b1180f442e...4c1cbbfb…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/56205903
--
You can configure recipients for build notifications in your .travis.yml file. See http://docs.travis-ci.com/user/notifications
Merlijn van Deen has submitted this change and it was merged.
Change subject: [FIX] Siteinfo: Correctly compare cache time
......................................................................
[FIX] Siteinfo: Correctly compare cache time
The expiry check worked backwards and didn't actually check if the
cached time was in the past (adding the expiry).
Bug: T94293
Change-Id: I7e43b0191b945c76dd19e30a560431bea928e4a0
---
M pywikibot/site.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
Merlijn van Deen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 457a917..1b1bef0 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -1226,7 +1226,8 @@
elif not cache_date: # default values are always expired
return True
else:
- return cache_date + expire >= datetime.datetime.utcnow()
+ # cached date + expiry are in the past if it's expired
+ return cache_date + expire < datetime.datetime.utcnow()
def _get_general(self, key, expiry):
"""
--
To view, visit https://gerrit.wikimedia.org/r/200300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7e43b0191b945c76dd19e30a560431bea928e4a0
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: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] ParamInfo: Read mustbeposted from help
......................................................................
[FEAT] ParamInfo: Read mustbeposted from help
When it reads the ParamInfo data from the help text it can interpret the
help text to determine whether an action requires to be posted.
Change-Id: Ia24e5280f21973b2d386d1e8912f689a859d7b26
---
M pywikibot/data/api.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Ricordisamoa: Looks good to me, but someone else must approve
XZise: Looks good to me, but someone else must approve
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 7946767..71cc0a9 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -430,6 +430,7 @@
start = help_text.find(mod_begin_string)
assert(start)
start += len(mod_begin_string)
+ end = help_text.find('\n*', start)
if help_text[start + 1] == '(' and help_text[start + 4] == ')':
prefix = help_text[start + 2:start + 4]
@@ -490,6 +491,9 @@
}
self._paraminfo[path]['parameters'] = params.values()
+ if (help_text.find('\n\nThis module only accepts POST '
+ 'requests.\n', start) < end):
+ self._paraminfo[path]['mustbeposted'] = ''
self._emulate_pageset()
--
To view, visit https://gerrit.wikimedia.org/r/199597
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia24e5280f21973b2d386d1e8912f689a859d7b26
Gerrit-PatchSet: 4
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 <>