jenkins-bot has submitted this change and it was merged.
Change subject: [fix] Fix epydoc markup for URLs
......................................................................
[fix] Fix epydoc markup for URLs
Change-Id: Id6c212d1be5b601cd46aaabcf3293a76559f4b51
---
M pywikibot/site.py
1 file changed, 4 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 9d16233..b198dc2 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4134,7 +4134,8 @@
The iterator yields dicts containing keys corresponding to the
block properties.
- @see: L{https://www.mediawiki.org/wiki/API:Blocks})
+
+ @see: U{https://www.mediawiki.org/wiki/API:Blocks}
@note: logevents only logs user blocks, while this method
iterates all blocks including IP ranges.
@@ -5386,11 +5387,11 @@
'never', 'infinite', 'indefinite' it never does. If the value is
given as a basestring it's parsed by php's strtotime function:
- L{http://php.net/manual/en/function.strtotime.php}
+ U{http://php.net/manual/en/function.strtotime.php}
The relative format is described there:
- L{http://php.net/manual/en/datetime.formats.relative.php}
+ U{http://php.net/manual/en/datetime.formats.relative.php}
It is recommended to not use a basestring if possible to be
independent of the API.
--
To view, visit https://gerrit.wikimedia.org/r/278915
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id6c212d1be5b601cd46aaabcf3293a76559f4b51
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: [FEAT] Enable iprange with site.blocks generator
......................................................................
[FEAT] Enable iprange with site.blocks generator
- mw API provides bkip parameter to filter an ip address or
an ip range block. Enable this feature with pywikibot.
- Add 'userid' to the list of retrieved properties for mw 1.18+.
- Also add some additional documentations.
Bug: T125303
Change-Id: I9f4698a0b8319f8fb869c46c7d82e8d25a189822
---
M pywikibot/site.py
1 file changed, 30 insertions(+), 7 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py
index 5b3183d..9d16233 100644
--- a/pywikibot/site.py
+++ b/pywikibot/site.py
@@ -4129,19 +4129,34 @@
@deprecated_args(step=None)
def blocks(self, starttime=None, endtime=None, reverse=False,
- blockids=None, users=None, total=None):
+ blockids=None, users=None, iprange=None, total=None):
"""Iterate all current blocks, in order of creation.
- Note that logevents only logs user blocks, while this method
- iterates all blocks including IP ranges. The iterator yields dicts
- containing keys corresponding to the block properties
- (see L{https://www.mediawiki.org/wiki/API:Blocks}).
+ The iterator yields dicts containing keys corresponding to the
+ block properties.
+ @see: L{https://www.mediawiki.org/wiki/API:Blocks})
+
+ @note: logevents only logs user blocks, while this method
+ iterates all blocks including IP ranges.
+ @note: C{userid} key will be given for mw 1.18+ only
+ @note: C{iprange} parameter cannot be used together with C{users}.
@param starttime: start iterating at this Timestamp
+ @type starttime: pywikibot.Timestamp
@param endtime: stop iterating at this Timestamp
+ @type endtime: pywikibot.Timestamp
@param reverse: if True, iterate oldest blocks first (default: newest)
- @param blockids: only iterate blocks with these id numbers
+ @type reverse: bool
+ @param blockids: only iterate blocks with these id numbers. Numbers
+ must be separated by '|' if given by a basestring.
+ @type blockids: basestring, tuple or list
@param users: only iterate blocks affecting these usernames or IPs
+ @type users: basestring, tuple or list
+ @param iprange: a single IP or an IP range. Ranges broader than
+ IPv4/16 or IPv6/19 are not accepted.
+ @type iprange: str
+ @param total: total amount of block entries
+ @type total: int
"""
if starttime and endtime:
if reverse:
@@ -4156,7 +4171,10 @@
"endtime must be before starttime with reverse=False")
bkgen = self._generator(api.ListGenerator, type_arg="blocks",
total=total)
- bkgen.request["bkprop"] = "id|user|by|timestamp|expiry|reason|range|flags"
+ bkgen.request['bkprop'] = ['id', 'user', 'by', 'timestamp', 'expiry',
+ 'reason', 'range', 'flags']
+ if MediaWikiVersion(self.version()) >= MediaWikiVersion('1.18'):
+ bkgen.request['bkprop'] += ['userid']
if starttime:
bkgen.request["bkstart"] = starttime
if endtime:
@@ -4173,6 +4191,8 @@
users = [user.upper() if is_IP(user) and '::' not in user else user
for user in users]
bkgen.request["bkusers"] = users
+ elif iprange:
+ bkgen.request['bkip'] = iprange
return bkgen
@deprecated_args(step=None)
@@ -4226,6 +4246,9 @@
start=None, end=None, reverse=False, tag=None, total=None):
"""Iterate all log entries.
+ @note: logevents with logtype='block' only logs user blocks whereas
+ site.blocks iterates all blocks including IP ranges.
+
@param logtype: only iterate entries of this type (see wiki
documentation for available types, which will include "block",
"protect", "rights", "delete", "upload", "move", "import",
--
To view, visit https://gerrit.wikimedia.org/r/267434
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9f4698a0b8319f8fb869c46c7d82e8d25a189822
Gerrit-PatchSet: 9
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>
Build Update for wikimedia/pywikibot-core
-------------------------------------
Build: #3350
Status: Errored
Duration: 1 hour, 31 minutes, and 52 seconds
Commit: 249813a (master)
Author: AbdealiJK
Message: tests/aspects: Skip setUpClass if TestCase skipped
The class IndexPageTestCase earlier checked for bs4 as a
class decorator. But that check doesn't seem to work and is
a known bug in nosetests. We now modify setUpClass() to also
be skipped if the class is supposed to be skipped.
Bug: T129965
Change-Id: Iec2f706aa832f7bd20e56fbc3427e8f315499591
View the changeset: https://github.com/wikimedia/pywikibot-core/compare/441268b55318...249813a5…
View the full build log and details: https://travis-ci.org/wikimedia/pywikibot-core/builds/117383039
--
You can configure recipients for build notifications in your .travis.yml file. See https://docs.travis-ci.com/user/notifications