Page MenuHomePhabricator

Supporting on-wiki list of replacements similar to fixes.py
Open, LowPublic

Description

A list of allowed/denied replacements are used in the hewp bots template.

This doesnt appear to be documented on the template page. https://he.wikipedia.org/wiki/%D7%AA%D7%91%D7%A0%D7%99%D7%AA:Bots

If we can obtain more detail about this usage, we can find a way to support it.

Event Timeline

jayvdb assigned this task to eranroz.
jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)
jayvdb added a project: Pywikibot.
jayvdb subscribed.

Thank you for being proactive and creating a bug for it.

Some more details on the requirements and the current implementations:

Pywikibot support:

  • pywikibot have fixes.py with some very specific fixes (such as music/datum for German). I think it is better to maintain such lists of replacements on wiki, so non programmers will be able to contribute to the replacement list. (Security note: it may be dangerous to have it on wiki but hewikiReplacebot: 1. sysops can protect such page. 2. the bot includes whitelist list of allowed editors)

@Matanya operates the bot in hewiki and he suggested we may include it in pywikibot/scripts ( https://github.com/eranroz/hewiki-ReplaceBot/issues/2 ). The question is whether there are other wikis that have (or would like to have) a on-wiki community maintained list of replacements?

eranroz renamed this task from hewiki {{bots}}/{{nobots}} is not supported to Supporting on-wiki list of replacements similar to fixes.py.Jun 13 2015, 7:34 AM
eranroz set Security to None.

Copied from https://gerrit.wikimedia.org/r/#/c/415520/

On many projects there already is some list of common fixes (see e.g. frwiki, cswiki or hewiki in https://www.wikidata.org/wiki/Q10957404 for WPCleaner or https://www.wikidata.org/wiki/Q6585066 for AWB). Pywikibot could read their syntax as well. I imagine something like (pseudo code):

$ pwb.py replace -fixes:local

fixes.py

fixes = []
if local and site, family in wd.Q10957404 and page(site, wd.Q10957404).exists():
    # read and translate WPCleaner fixes to Pywikibot fixes
    fixes += wpc_fixes
if local and site, family in wd.Q6585066 and page(site, wd.Q6585066).exists():
    # read and translate AWB fixes to Pywikibot fixes
    fixes += awb_fixes
if local and site, family in fixes_pages_dict and page(site, fixes_pages_dict[site]).exists():
    fixes += page(site, fixes_pages_dict[site]).text
# fix fixes

Thank you for being proactive and creating a bug for it.

Some more details on the requirements and the current implementations:

Pywikibot support:

  • pywikibot have fixes.py with some very specific fixes (such as music/datum for German). I think it is better to maintain such lists of replacements on wiki, so non programmers will be able to contribute to the replacement list. (Security note: it may be dangerous to have it on wiki but hewikiReplacebot: 1. sysops can protect such page. 2. the bot includes whitelist list of allowed editors)

@Matanya operates the bot in hewiki and he suggested we may include it in pywikibot/scripts ( https://github.com/eranroz/hewiki-ReplaceBot/issues/2 ). The question is whether there are other wikis that have (or would like to have) a on-wiki community maintained list of replacements?

And Urdu Wikipedia also implemented this bot.

Plan from abandoned patch:

Module to gather and run fixes from several sources.

This module can load all the available fixes from multiple sources
and apply more of them at once to a specified page text. It can process
on-wiki defined fixes in AutoWikiBrowser, WPCleaner and Pywikibot
formats, local user-fixes.py file and also some other fixes sent within
the calling script after-save hook. Some sample fixes are prepared
in the L{fixes script<scripts.fixes>}.

Todo
----
- rethink the dividing line between fixes and cc! find a way to support both of them on-wiki (possibly dangerous)? or support both of them locally (already works for user-fixes file right)?
- refine current Pywikibot fixes format
- run fixes on save hook for any script (not just replace.py) (script defined, global param?)
- allow to run defined set of fixes automatically on cc hook (config option, user-changes file)?
- allow to run fixes independently (instead of replace.py -fix:a -fix:b, just fixes.py a b)?

- load on-wiki fixes
- load local file fixes
- move some of the current fixes on-wiki
- what about the rest? leave them in some sort of sample file? or move the rest to the cc?
- check loaded fixes for syntax errors
- parse Pywikibot format (how was that parsed before?)
- parse AWB and WPCleaner format from on-wiki source (ask them for help)
- let's make Pywikibot great!
Xqt triaged this task as Low priority.Sep 29 2018, 5:07 AM

@Dvorapa: could you link that path for reusing it?

Aklapper added a subscriber: eranroz.

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)