Page MenuHomePhabricator

prefer userscripts over scripts
Closed, ResolvedPublic


currently wrapper script searches for scripts in several folders. The order is given in find_filename function:

script_paths = ['scripts',

If a user_script_path is given in that path is priorized. But we have a default empty userscript path. But currently that path is the last to be searched for scripts. I propose to priorizes userscripts over scripts. This gives the ability to run a customized script with the same filename found in framework script folder.

Event Timeline

Xqt created this task.Mar 24 2020, 7:56 AM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptMar 24 2020, 7:56 AM
Xqt triaged this task as Low priority.Mar 24 2020, 7:56 AM
Huji awarded a token.Mar 24 2020, 11:41 AM

Hi @Xqt ,
In it is mentioned that user_script_path is search in this given order:

  1. scripts
  2. scripts/maintenance
  3. scripts/archive

But in the find_filename function, there is no search in archives. Do we need to add this too in script_paths?

Hi @Mh-3110 ,
no, the other way around :) We need to remove scripts/archive from

Ok @Dvorapa ,
I will work on this ticket.

Mh-3110 claimed this task.Mar 25 2020, 9:06 AM

@Dvorapa ,

currently is ignored as listed in .gitignore .
can I exclude it from the .gitignore file to update it?


Xqt added a comment.Mar 25 2020, 2:48 PM

@Dvorapa ,

currently is ignored as listed in .gitignore .
can I exclude it from the .gitignore file to update it?


No because is a private settings file which may override settings done by Therefore you should change the doc in only. The new order should be:

  1. user_script_paths in the given order
  2. scripts/userscripts
  3. scripts
  4. scripts/maintenance

And script_path in find_filename must be updated accordingly.

Change 583362 had a related patch set uploaded (by Mh-3110; owner: Mahuton):
[pywikibot/core@master] [IMPR]-Prefer userscripts over scripts

Thanks @Xqt
Patch submitted

Mh-3110 moved this task from Backlog to Needs Review on the Pywikibot board.Mar 25 2020, 3:32 PM

Change 583362 merged by jenkins-bot:
[pywikibot/core@master] [IMPR] Prefer userscripts over scripts

Xqt closed this task as Resolved.Mar 25 2020, 7:11 PM