Last modified: 2014-04-20 16:14:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64008, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62008 - Add commonsMedia datatype to harvest_template.py
Add commonsMedia datatype to harvest_template.py
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
Wikidata (Other open bugs)
core-(2.0)
All All
: Unprioritized normal
: ---
Assigned To: Maarten Dammers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-27 17:54 UTC by Maarten Dammers
Modified: 2014-04-20 16:14 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Maarten Dammers 2014-02-27 17:54:41 UTC
As pointed out in https://www.wikidata.org/wiki/User:Underlying_lk/sandbox#commonsMedia_support_in_harvest_template , it should be relatively easy to add image support.

elif claim.getType() == 'commonsMedia':
    mediasite = pywikibot.Site("commons", "commons")
    image = pywikibot.ImagePage(mediasite, value)
    claim.setTarget(image)

Instead of using ImagePage I think Link() should be used.
Comment 1 Gerrit Notification Bot 2014-04-20 15:46:48 UTC
Change 127478 had a related patch set uploaded by Multichill:
(bug 62008) Added support for images

https://gerrit.wikimedia.org/r/127478
Comment 2 Gerrit Notification Bot 2014-04-20 16:12:12 UTC
Change 127478 merged by jenkins-bot:
(bug 62008) Added support for images Now with checking for redirect and if the image actually exists

https://gerrit.wikimedia.org/r/127478
Comment 3 Maarten Dammers 2014-04-20 16:14:36 UTC
Implemented. Added a bit more checking:
* Uses Link instead of Page directly
* Checks if the imagepage is a redirect
* Checks if the image actually exists

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links