Xqt has submitted this change and it was merged.
Change subject: Implement "url" datatype in Wikibase ......................................................................
Implement "url" datatype in Wikibase
Change-Id: I376c780d9f7642a6022137d3e48957acac5dfc9f --- M pywikibot/page.py 1 file changed, 3 insertions(+), 2 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved jenkins-bot: Checked
diff --git a/pywikibot/page.py b/pywikibot/page.py index 6203459..d9bc7ff 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2787,7 +2787,7 @@ elif claim.getType() == 'globecoordinate': claim.target = pywikibot.Coordinate.fromWikibase(data['mainsnak']['datavalue']['value'], site) else: - #This covers string type + #This covers string, url types claim.target = data['mainsnak']['datavalue']['value'] if 'references' in data: for source in data['references']: @@ -2838,6 +2838,7 @@ 'string': basestring, 'commonsMedia': ImagePage, 'globecoordinate': pywikibot.Coordinate, + 'url': basestring, } if self.getType() in types: if not isinstance(value, types[self.getType()]): @@ -2924,7 +2925,7 @@ if self.getType() == 'wikibase-item': value = {'entity-type': 'item', 'numeric-id': self.getTarget().getID(numeric=True)} - elif self.getType() == 'string': + elif self.getType() in ['string', 'url']: value = self.getTarget() elif self.getType() == 'commonsMedia': value = self.getTarget().title(withNamespace=False)
pywikibot-commits@lists.wikimedia.org