Page MenuHomePhabricator

Integrate Extension:GlobalUserPage into pywikibot
Open, Needs TriagePublic

Description

The MW extension GlobalUserPage allows users to have a single userpage on meta instead of one on single wiki. The meta userpage is shown on every farm wiki's userpage of the user.
Here a sample with Utilisateur:Louvain_Coopération on frwiki that shows in the browser User:Louvain_Coopération on meta.

We can't know with pywikibot that an userpage exists without having to manually check the existence of a page on meta.
Please not that Mediawiki considers that the page exist in this case because it show link to userpage in blue.

>>> import pywikibot as p
>>> p.Page(p.Site(), u'Utilisateur:Louvain_Coopération')
Page(Utilisateur:Louvain Coopération)
>>> p.Page(p.Site(), u'Utilisateur:Louvain_Coopération').exists()
False
>>> p.Page(p.Site(), u'Utilisateur:Louvain_Coopération').text
u''
>>> p.Page(p.Site(), u'Utilisateur:Louvain_Coopération').get()
pywikibot.exceptions.NoPage: Page [[fr:Utilisateur:Louvain Coopération]] doesn't exist.
>>> p.Page(p.Site(), u'Utilisateur:Louvain_Coopération').isRedirectPage()
False
>>> p.Page(p.Site('meta', 'meta'), u'User:Louvain_Coopération').exists()
True
>>> len(p.Page(p.Site('meta', 'meta'), u'User:Louvain_Coopération').get())
4127

Event Timeline

I hope this behavior is correct, because the site is just filled with a content from Meta, but the page still does not exist. If user wants to create it by pywikibot in order to beat that content from Meta, pywikibot should respond with status like: "Yeah, you can create it, there is no page on this place". This is not a redirect