http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11652
Revision: 11652 Author: legoktm Date: 2013-06-16 07:39:06 +0000 (Sun, 16 Jun 2013) Log Message: ----------- Allow for addition of string properties
Modified Paths: -------------- branches/rewrite/scripts/claimit.py
Modified: branches/rewrite/scripts/claimit.py =================================================================== --- branches/rewrite/scripts/claimit.py 2013-06-15 13:24:58 UTC (rev 11651) +++ branches/rewrite/scripts/claimit.py 2013-06-16 07:39:06 UTC (rev 11652) @@ -87,7 +87,13 @@
for i in xrange (0, len(commandline_claims), 2): claim = pywikibot.Claim(repo, commandline_claims[i]) - claim.setTarget(pywikibot.ItemPage(repo, commandline_claims[i+1])) + if claim.getType() == 'wikibase-item': + target = pywikibot.ItemPage(repo, commandline_claims[i+1]) + elif claim.getType() == 'string': + target = commandline_claims[i+1] + else: + raise NotImplementedError("%s datatype is not yet supported by claimit.py" % claim.getType()) + claim.setTarget(target) claims.append(claim)
generator = gen.getCombinedGenerator()
pywikipedia-svn@lists.wikimedia.org