Skip to content
Snippets Groups Projects
Commit f38347c9 authored by Luke Faraone's avatar Luke Faraone
Browse files

Add support for querying the CheckUser log.

parent 3a1fc864
No related branches found
No related tags found
No related merge requests found
......@@ -662,6 +662,12 @@ class Site(object):
end=end, dir=dir, user=user, title=title, action=action))
return listing.List(self, 'logevents', 'le', limit=limit, **kwargs)
def checkuserlog(self, user=None, target=None, limit=10, dir='older', start=None, end=None):
kwargs = dict(listing.List.generate_kwargs('cul', target=target, start=start,
end=end, dir=dir, user=user))
return listing.NestedList('entries', self, 'checkuserlog', 'cul', limit=limit, **kwargs)
# def protectedtitles requires 1.15
def random(self, namespace, limit=20):
"""Retrieves a generator of random page from a particular namespace.
......
......@@ -107,6 +107,15 @@ class List(object):
return List
class NestedList(List):
def __init__(self, nested_param, *args, **kwargs):
List.__init__(self, *args, **kwargs)
self.nested_param = nested_param
def set_iter(self, data):
self._iter = iter(data['query'][self.result_member][self.nested_param])
class GeneratorList(List):
def __init__(self, site, list_name, prefix, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment