GSoC/GCI Archive
Google Code-in 2014 Wikimedia Foundation

Pywikibot batch upload

completed by: murfel

mentors: Fabian, John Vandenberg

Pywikibot (PWB) is a Python-based framework to write bots for MediaWiki websites. See https://www.mediawiki.org/wiki/Manual:Pywikibot for more information. Patches can be submitted via Gerrit (you need a MediaWiki.org account). More documentation on Gerrit can be found at https://www.mediawiki.org/wiki/Manual:Pywikibot/Gerrit. After you have successfully claimed this task in Google Melange please do use the task in Phabricator for communication instead of Google Melange. This allows more PWB developers to be reached! General development questions can be asked on the Pywikibot mailing list at https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l and the #pywikibot IRC channel (see https://www.mediawiki.org/wiki/MediaWiki_on_IRC).

Pywikibot includes a script (upload.py) which uploads a single file to a MediaWiki site.  The script consists of a class "UploadRobot" which is a 'bot', and a function main which parses command line options and invokes the bot.

This task is to extend the upload.py script so that:

  1. the class "UploadRobot" supports uploading a list of files to a MediaWiki site, and
  2. the main function allows command line options that can be used to instruct the bot to upload all files contained within a local directory using the same description for each upload file.

The Phabricator page for this task is https://phabricator.wikimedia.org/T57088 .

To complete this task, a unit test must be added to invoke the class "UploadRobot" to upload multiple files, and the travis-ci build be successful except for unrelated breakages which might occur.  Existing upload tests can be found in  tests/upload_tests.py .

Students are required to read Wikimedia's general instructions at https://www.mediawiki.org/wiki/Google_Code-in_2014#Instructions_for_GCI_students first.


Always refer to https://www.mediawiki.org/wiki/Google_Code-in_2014#Instructions_for_GCI_students for general information and phabricator.wikimedia.org for information on specific tasks.