Legoktm has uploaded a new change for review.

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


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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/68/82068/1

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 59108e3..1cf9027 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -2753,7 +2753,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']:
@@ -2798,6 +2798,7 @@
                  'string': basestring,
                  'commonsMedia': ImagePage,
                  'globecoordinate': pywikibot.Coordinate,
+                 'url': basestring,
                  }
         if self.getType() in types:
             if not isinstance(value, types[self.getType()]):
@@ -2869,7 +2870,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)

-- 
To view, visit https://gerrit.wikimedia.org/r/82068
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I376c780d9f7642a6022137d3e48957acac5dfc9f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to