Page MenuHomePhabricator

replace.py and one-by-one modification
Open, LowPublicFeature

Description

Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/288/
Reported by: crochet_david
Created on: 2011-07-20 10:02:48
Subject: replace.by and one-by-one modification
Original description:
When the robots need to make multiple modification in a one page, it do it all.
But, in some case, some modifications not need to be done.

So add a new parametre as "-single" to tell each modification to be done in a page


Version: unspecified
Severity: enhancement
See Also:
https://sourceforge.net/p/pywikipediabot/feature-requests/288

Details

Reference
bz55046

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:16 AM
bzimport set Reference to bz55046.
bzimport added a subscriber: Unknown Object (????).

Hi David,
by the time it will be solved within textlib.py \(it has the replaceExcept\(\) function\), I warmly suggest you this tutorial that I wrote recently:
http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes\_and\_functions\_HOWTO
Your problem is solved there. Have fun\!

Replace.py calls replaceExcept\(\) from textlib.py, but the confirmation of replacements offered by textlib.py takes place in replace.py. Therefore it would be very difficult.

But there is a way to do that with a very small programming. Please have a look at http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bin%C3%A1ris/Fixes\_and\_functions\_HOWTO\#Choosing\_between\_two\_replacements\_in\_runtime\_.2F\_K.C3.A9t\_csere\_k.C3.B6z.C3.B6tti\_v.C3.A1laszt.C3.A1s\_fut.C3.A1sid.C5.91ben, where the first example is your friend. With a minimal rewrite of it you may confirm each modification separately. I think this is much simpler than rewrite both replace.py and textlib.py.

Is that an appropriate solution for your peoblem?

This already works in some of PWB scripts (perhaps redirect or something)..

Aklapper triaged this task as Low priority.Feb 4 2022, 10:51 AM
Aklapper changed the subtype of this task from "Task" to "Feature Request".