Page MenuHomePhabricator

Add support for item without link to harvest_template
Closed, ResolvedPublic

Description

It would be very useful if harvest_template could add properties type item also in case, when they are not formatted like [[foo]]

example:

city = [[Berlin]] is OK
state= Germany is not OK even if the template formats this as link.

example of command:

harvest_template -template:"Infobox" state P123 -islink

Details

Reference
bz62014
Related Gerrit Patches:

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport added a project: Pywikibot-Wikidata.
bzimport set Reference to bz62014.
bzimport added a subscriber: Unknown Object (????).
JAnD created this task.Feb 27 2014, 7:32 PM
jayvdb moved this task from Backlog to Framework on the Pywikibot-Wikidata board.Nov 30 2014, 12:10 PM
JAnD triaged this task as Normal priority.Mar 15 2016, 7:15 AM
JAnD updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 15 2016, 7:15 AM
JAnD claimed this task.Mar 15 2016, 8:08 AM


lines 188-201 does the requested

JAnD added a comment.Mar 15 2016, 11:03 AM

I tried to upload it via uploader, but I don't know, where is it now.
I tried to run git on windows, but it was too difficult for me

There is some ugly patch including commnted old part of code + already merged patch for external-id
originally form https://www.wikidata.org/w/index.php?title=User:Underlying_lk/harvest_template.py&oldid=117969578

Xqt added a subscriber: Xqt.Mar 15 2016, 11:19 AM

I tried to upload it via uploader, but I don't know, where is it now.

See :
https://www.mediawiki.org/wiki/Gerrit_patch_uploader
https://tools.wmflabs.org/gerrit-patch-uploader/

JAnD added a comment.Mar 15 2016, 12:46 PM
In T64014#2122183, @Xqt wrote:
Result from uploading patch: 
/data/project/gerrit-patch-uploader/git/bin/git clone --depth=1 ssh://gerrit/pywikibot/core /tmp/3585641.1.webgrid-lighttpd/tmpSE65T9
Cloning into '/tmp/3585641.1.webgrid-lighttpd/tmpSE65T9'...
Total 964 (delta 403), reused 367 (delta 179)

/data/project/gerrit-patch-uploader/git/bin/git rev-parse --abbrev-ref HEAD
Will commit to branch: master

But I am not able to find, where is my patch now. Or will be visible after some time?

JAnD removed JAnD as the assignee of this task.Jul 7 2017, 12:04 PM

is there anybody who is able to merge this patch?

Xqt added a comment.Jul 7 2017, 12:28 PM

patch failed:

git.exe am --ignore-space-change "C:\pwb\GIT\core\ht_patch.patch"
Patch format detection failed.

Fail
Xqt changed the task status from Open to Stalled.Jul 7 2017, 12:59 PM

I checked your code subitted above and I found out that your local repository is 3 years behind the current framework release. Please update your bot first and verify whether this bug still exists.

JAnD added a comment.EditedJul 7 2017, 1:18 PM
In T64014#3415342, @Xqt wrote:

I checked your code subitted above and I found out that your local repository is 3 years behind the current framework release. Please update your bot first and verify whether this bug still exists.

Yes, bug still exists, harvest_template.py cannot harves not-formated statements.
when I posted this patch, it worked.
I thin it will not be big problem to implement it, but I am not the right one to do it.

XXN added a subscriber: XXN.EditedJul 8 2017, 3:43 PM

Regarding the proposed patch(es) above.
While for individual tasks for personal use these changes may be ok (I also have locally several forks of some scripts:) ), in the current state it will not be accepted in gerrit by reviewers. Since we don't want *always* to treat any plain text in template parameters as a unlinked wikilink and to try to find their item, more code is needed here to define the new option as an optional feature.

XXN changed the task status from Stalled to Open.Jul 8 2017, 3:48 PM

This idea is good.
There are many usescases around multiple major wikis, and I think Pasleim's harvest_template analogue already has such a feature enabled.
A patch is welcome.

Change 364117 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[pywikibot/core@master] [DNM] Add support for item without link to harvest_template

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

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

Uploaded a refactored version of T64014#2121595.

I think Pasleim's harvest_template analogue already has such a feature enabled.

Yes, it does. Unlike PWB, HarvestTemplates allows only a single parameter to be parsed. If this is to be an optional feature, an overhaul needs to be done to the script.

Xqt closed this task as Resolved.Jul 9 2017, 6:33 PM
Xqt claimed this task.

Change 364117 merged by jenkins-bot:
[pywikibot/core@master] [DNM] Add support for item without link to harvest_template

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

XXN added a comment.EditedJul 10 2017, 11:06 AM

If this is to be an optional feature, an overhaul needs to be done to the script.

IMO this feature should be implemented ONLY as optional, because it is not always safe to import blindly any unliked value, and there could be imported some weird values, at least on some wikis. The user operating bot should decide himself if they want to assume such risk or not.

matej_suchanek reopened this task as Open.Jul 11 2017, 2:30 PM
matej_suchanek claimed this task.
matej_suchanek removed a project: Patch-For-Review.

Change 364475 had a related patch set uploaded (by Matěj Suchánek; owner: Matěj Suchánek):
[pywikibot/core@master] [IMPR] Enhance argument management in harvest_template.py

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

Change 364475 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Enhance argument management in harvest_template.py

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

matej_suchanek closed this task as Resolved.Aug 8 2017, 8:03 AM
matej_suchanek removed a project: Patch-For-Review.