matej_suchanek added a comment.

Replacement management in replace.py gives me a headache.

Me too after your clarification. But I believe we can handle that.

There is just a few scenarios: (pwb.py replace only run with...)

  1. -manualinput with one or more pairs
  2. a single -fix
  3. multiple -fix'es
  4. one or more -fix'es and -manualinput with one or more pairs

My opinion:

  • -regex (-dotall, -nocase etc.) shouldn't influence individual fixes
  • when only -fix'es are requested, all of them should inherit all exceptions (-excepttext etc.)
  • when all replacements come from command line, apply exceptions to all of them ("squash" replacements to a single -fix)

Now there's only one remaining point: combined input. I would introduce a new -inherit argument that would optionally make all command line exceptions inherited to all fixes (as well as the "squashed" one), otherwise (default behavior) it would only be relevant for command line replacements.

Comments?


TASK DETAIL
https://phabricator.wikimedia.org/T175399

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: matej_suchanek
Cc: Mpaa, Aklapper, matej_suchanek, pywikibot-bugs-list, Magul, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, jayvdb, Dalba, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to