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

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:01 AM
bzimport set Reference to bz62014.
bzimport added a subscriber: Unknown Object (????).
JAnD triaged this task as Medium priority.Mar 15 2016, 7:15 AM
JAnD updated the task description. (Show Details)


lines 188-201 does the requested

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

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?

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.

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.

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

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.

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