Page MenuHomePhabricator

In the Pywikibot "unusedfiles.py" script, add "template_to_the_image" at the top of the image page, not the bottom of it
Open, MediumPublicFeature

Description

Hi, I just noticed that the Pywikibot "unusedfiles.py" script, adds "template_to_the_image" templates/tags to the bottom of the image/file pages. These type of templates/tags should be added to the top of the pages, not the bottom of the page.

Note: The script also adds a speedy deletion notice message to the bottom of the uploader's talk page. This should not be modified.
If I am unclear or wrong, please let me know. Thanks!

Event Timeline

Xqt triaged this task as Medium priority.Aug 27 2023, 4:48 PM
Xqt changed the subtype of this task from "Task" to "Feature Request".
Xqt subscribed.

Refer the doumentation:
This bot appends some text to all unused images

I change this task to a feature request. An additional option -up could be implemented like we have in add_text script

Would that be in your interest?

@Xqt, Thank you for your reply! Yes, the additional -up option can fix the problem, but it doesn't have to affect the message sent to the uploader's talk page. However, (in my opinion) adding the tag to the top of the image/file pages should be made the default option, rather than implemented by adding the -up option because as far as I know all tags are added at the top of articles and pages except for a few ones. Such as those related to categories; like this one: Template:Uncategorized). Thanks!

@Xqt, Can you please care about this please? This is not difficult.

Change 1005796 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] add -up option to unusedfiles to add template on top of the page

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

@Xqt, Special thanks! Technically, it is now working for me as I wanted. But I think we didn't want to create -up because almost all these kind of templates should be placed above. However, if you still consider it necessary, then we may need to make "-up" the default. If you don't want to do so, I'm still good with your update now.
Please do these replacements:
immageimage.
maximum number of articlesmaximum number of pages|images|files (I don't know which one is the best).
-nouserwarning-nouserwarning: (Just a colon).
I'll vote in the next edit. Thanks!

Sorry, I just found a new problem. I used -always. First warning was good, but second warning was just changing the file title of the first warning instead of adding a new message. I checked the diff changes and they were okay, but that second edit says something else. This time, I tried to manually save edits by pressing y and I didn't find the same case. So, there is something wrong with -always parameter.

Hi @Aram: I removed the -up option and made it default as suggested. I didn't found the immageimage for replacemet within the code. The -nouserwarning is right as it it because this is just a but to be set instead of additional input requirements for that option.

I wasn't able to reproduce the later one yet; maye I have to make some tests on tes-wiki.

Hi @Aram: I removed the -up option and made it default as suggested. I didn't found the immageimage for replacemet within the code. The -nouserwarning is right as it it because this is just a but to be set instead of additional input requirements for that option.

No, -up is still not the default and I have to use it to see the template at top. You can see immage in patchset 2 and looks like you've replaced it to image in patchset 3. But if we make the up as default, we don't need -up anymore, but we need -down instead. Am I right?

I wasn't able to reproduce the later one yet; maye I have to make some tests on tes-wiki.

Umm... It should be the same for you too because I'm using latest updates.