Stop trying to use kwargs with get_recent_changes.

This commit is contained in:
Edward Betts 2023-05-14 14:22:37 +00:00
parent 33bda7f54b
commit 716d3f1a02
1 changed files with 7 additions and 5 deletions

View File

@ -38,7 +38,9 @@ def get_revision_timestamp(revid: int) -> str:
return cast(str, rev["timestamp"]) return cast(str, rev["timestamp"])
def get_recent_changes(**kwargs: CallParams) -> requests.Response: def get_recent_changes(
rcstart: str | None = None, rccontinue: str | None = None
) -> requests.Response:
"""Get list of recent changes.""" """Get list of recent changes."""
props = [ props = [
"title", "title",
@ -54,14 +56,14 @@ def get_recent_changes(**kwargs: CallParams) -> requests.Response:
"action": "query", "action": "query",
"list": "recentchanges", "list": "recentchanges",
"rcnamespace": 0, "rcnamespace": 0,
# "rctype": "log",
# "rclimit": "max",
"rclimit": "max", "rclimit": "max",
# "rcstart": start,
"rcdir": "newer", "rcdir": "newer",
"rcprop": "|".join(props), "rcprop": "|".join(props),
**{k: cast(str | int, v) for k, v in kwargs.items() if v},
} }
if rcstart is not None:
params["rcstart"] = rcstart
if rccontinue is not None:
params["rccontinue"] = rccontinue
return api_get(params) return api_get(params)