Page MenuHomePhabricator

Option to delete image in imagecopy.py once it's been transferred
Closed, ResolvedPublic

Description

Pywikibot is a Python-based framework to write bots for MediaWiki (more information).

Once an image has been copied with imagecopy.py and a sysop account is configured for that wiki, we should provide an option to delete the image.

You need to add a new param in scripts/imagecopy.py. Then add at the end of the process, after the import on Wikimedia Commons, add a check that verifies if the new param was enabled and if the user has sysop rights, then delete the old picture.

You are expected to provide a patch in Wikimedia Gerrit. Documentation on Gerrit is available.

Details

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:20 AM
bzimport set Reference to bz55522.
bzimport added a subscriber: Unknown Object (????).
Aklapper lowered the priority of this task from Low to Lowest.Jun 5 2015, 1:41 PM
Aklapper subscribed.

Pywikibot has two versions: Compat and Core. This task was filed about the older version, called Pywikibot-compat, which is not under active development anymore. Hence I'm lowering the priority of this task to reflect the reality. Unfortunately, the Pywikibot team does not have the manpower to retest every single bug report / feature request against the (maintained) Pywikibot code base. Furthermore, the code base of Pywikibot-Compat has changed a lot compared to the code base of Pywikibot-Core so there is a chance that the problem described in this task might not exist anymore. Please help: Unfortunately manpower is limited and does not allow testing every single reported task again. If you have time and interest in Pywikibot, please upgrade to Pywikibot-Core and add a comment to this task if the problem in this task still happens in Pywikibot-Core (or directly edit the task by removing the Pywikibot-compat project and adding the Pywikibot project to this task). To learn more about Pywikibot and to get involved in its development, please check out https://www.mediawiki.org/wiki/Manual:Pywikibot/Development Thank you for your understanding.

Xqt subscribed.

Might become a core enhancement but declined for compat due to the deprecation.

Framawiki raised the priority of this task from Lowest to Low.Nov 3 2017, 10:45 AM
Framawiki subscribed.

I purpose to mentor this task for Google-Code-in-2017. The big @Aklapper message is not to be taken into account, the script also exists for core.

You need to add a new param in scripts/imagecopy.py. Then add at the end of the process, after the import on Commons, add a check that verify if the new param was enabled and if the user has sysop rights, then delete the old picture.

Aklapper updated the task description. (Show Details)

Change 396910 had a related patch set uploaded (by Rafidaslam; owner: rafid):
[pywikibot/core@master] scripts/imagecopy.py: Add -delete option

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

Just made a patch for this on gerrit^, for running this script I had to make some modifications in the script (since some parts are not working in my machine). and a note, I haven't test it yet, since I don't have a sysop privilege in any wiki.

Change 396910 merged by jenkins-bot:
[pywikibot/core@master] scripts/imagecopy.py: Add -delete option

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

@rafidaslam You can ask for sysop rights for testing purposes on testwiki and in a few hours you will get them ;)

@rafidaslam The request was not successful, not sure why. You can try these alternatives to test, but you have to configure a family using generate_family_file: https://test.wikipedia.org/wiki/Wikipedia:Requests/Tools