Page MenuHomePhabricator
Authored By
JAnD
Mar 15 2016, 11:01 AM
Size
1 KB
Referenced Files
None
Subscribers
None

ht_patch

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
--- C:/pwb/scripts/harvest_template.py út bøe 15 08:55:42 2016
+++ C:/pwb/scripts/harvest_template3.py út bøe 15 01:08:22 2016
@@ -175 +175 @@ class HarvestRobot(WikidataBot):
- """if not match:
+ if not match:
@@ -187,16 +187 @@ class HarvestRobot(WikidataBot):
- claim.setTarget(linked_item)"""
- if match != None:
- value = match.group(1)
- try:
- link = pywikibot.Link(value)
- linkedPage = pywikibot.Page(link)
- if linkedPage.isRedirectPage():
- linkedPage = linkedPage.getRedirectTarget()
- linkedItem = pywikibot.ItemPage.fromPage(linkedPage)
- claim.setTarget(linkedItem)
- if not linkedItem.title():
- print " " # this is only to raise NoPage
- except pywikibot.exceptions.NoPage:
- pywikibot.output('%s doesn\'t exist so I can\'t link to it' % (linkedPage,))
- continue
-
+ claim.setTarget(linked_item)
@@ -205,2 +189,0 @@ class HarvestRobot(WikidataBot):
- elif claim.type == 'external-id':
- claim.setTarget(value.strip())

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3516900
Default Alt Text
ht_patch (1 KB)

Event Timeline