Page MenuHomePhabricator

Support new geo-shape datatype in Pywikibot
Closed, ResolvedPublic

Description

With T161543: Enable geoshape datatype on Wikidata there will be a new datatype around meaning pywikibot will cry whenever it encounters a page with one of these.

From pywikibot's point of view this should be similar to how Commons-media was implemented.

However the big difference is that we haven't implemented a DataPage class (or a map subclass of this) to deal with the new capabilities on Commons.

An alternative (or temporary work around) would be to create a new type in __init__.py which takes a normal Page object but validates that it has the Map.JsonConfig content-type* (or any other restrictions, such as namespace, implemented by Wikibase).

  • Wikibase checks that the page exists on Commons and that the title fullfills '/^Data:[^\\[\\]#\\\:{|}]+\.map$/u'

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 29 2017, 5:25 PM
Lokal_Profil renamed this task from Suport new geoshape datatype in Pywikibot to Suport new geo-shape datatype in Pywikibot.Mar 29 2017, 5:29 PM
Mpaa renamed this task from Suport new geo-shape datatype in Pywikibot to Support new geo-shape datatype in Pywikibot.Mar 29 2017, 6:51 PM

I'm putting together a work around through __init__.py, got it to work just need to add tests.

Change 346700 had a related patch set uploaded (by Lokal Profil):
[pywikibot/core@master] Add support for geo-shape Wikibase data type

https://gerrit.wikimedia.org/r/346700

Change 346700 merged by jenkins-bot:
[pywikibot/core@master] Add support for geo-shape Wikibase data type

https://gerrit.wikimedia.org/r/346700

Lokal_Profil closed this task as Resolved.Apr 10 2017, 11:31 AM

For now the url is hardcoded in the family file. Once T162561: Expose geoShapeStorageFrontendUrl through siteinfo is resolved we should instead get to it through the api.