pywikibot's user object should have a function to check if an account is currently locked. I would envision this working almost identically to isBlocked(), which is already implemented.
Description
Description
Details
Details
Related Changes in Gerrit:
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| [IMPR] Provide is_locked method | pywikibot/core | master | +124 -30 |
Event Timeline
Comment Actions
The "vanilla" requests code that would accomplish this (using the same format as API:Users) is:
import requests
S = requests.Session()
URL = "https://en.wikipedia.org/w/api.php"
PARAMS = {
"action": "query",
"format": "json",
"meta": "globaluserinfo",
"guiuser": "TonjaHeritage2",
"guiprop": "groups|merged|unattached"
}
R = S.get(url=URL, params=PARAMS)
DATA = R.json()
print('locked' in DATA["query"]["globaluserinfo"])Comment Actions
Change 738509 had a related patch set uploaded (by Xqt; author: Xqt):
[pywikibot/core@master] [IMPR] Provide is_locked method
Comment Actions
Change 738509 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Provide is_locked method