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 created this task.Jun 13 2015, 2:07 AM
jayvdb updated the task description. (Show Details)
jayvdb raised the priority of this task from to Needs Triage.
jayvdb assigned this task to eranroz.
jayvdb added a project: Pywikibot.
jayvdb added a subscriber: jayvdb.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJun 13 2015, 2:07 AM

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.
Xqt added a subscriber: Xqt.Jun 13 2015, 8:35 AM
Dvorapa added a subscriber: Dvorapa.EditedMar 2 2018, 10:09 AM

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
Framawiki added a subscriber: Framawiki.
MuhammadShuaib added a comment.EditedMar 12 2018, 11:57 AM

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

Some more details on the requirements and the current implementations:

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
Xqt added a comment.Sep 29 2018, 5:09 AM

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

D3r1ck01 moved this task from Backlog to Needs Review on the Pywikibot board.Nov 5 2018, 11:35 AM