Page MenuHomePhabricator

Write an equivalent of SpecialUpload::getInitialPageText for Gdrives uploader
Closed, ResolvedPublic

Description

During a file upload, we need to send the right initial page text to the upload API to populate the license, comment, copystatus and source correctly. On Mediawiki side, we use this function https://github.com/wikimedia/mediawiki/blob/master/includes/specials/SpecialUpload.php#L616-662 to create this text.

We need to have an equivalent of this function in our upload script to generate the right text string. The function should go into https://github.com/tonythomas01/gdrive-to-commons/blob/master/uploader/wiki_uploader.py file and should be of the following form:

def get_initial_page_text(license='', summary='')
      """
      Should return something similar to: 
      == Summary ==
      Summary goes here. 
      == Licensing ==
      {{PD-old-70|Unclear-PD-US-old-70}}
      """
      return

Later, we need to make it support copyrighted files, but that is a different task.

Event Timeline

This could even be a possible Google-Code-in-2019 task.

Feel free to add that tag if you want to mentor this task.

Is this still open? I would like to take this up!

Should we be sticking just with license and summary or should we also add information about the source of the image as well? This can be a separate task as well. Thoughts?

Closing it as resolved. Thank you!