Page MenuHomePhabricator

Move add_text functionality to textlib
Closed, ResolvedPublicFeature

Description

Background

add_text functions are re-used within scripts but they should not be imported but the functionality has to be provided by the framework api, not by the scripts. Bot scripts should derive from BaseBot (sub)class(es).

What to do

  1. move add_text function to textlib. This should only contain text functionality without getting and putting the text. The interface should be like
def add_text(text: str, new_text: str, *, <other keyword options>) -> str:
  1. deprecate get_text, put_text and add_text in add_text.py script
  2. Reimplement add_text.py script using BaseBot (sub)class(es)
  3. Update tests
  4. Update commonscat.py script

Additional Informations

Event Timeline

Xqt triaged this task as Medium priority.Jun 6 2021, 11:13 AM
Xqt changed the subtype of this task from "Task" to "Feature Request".

Change 698336 had a related patch set uploaded (by Zabe; author: Zabe):

[pywikibot/core@master] Move add_text functionality to textlib

https://gerrit.wikimedia.org/r/698336

Xqt updated the task description. (Show Details)
Zabe subscribed.

Change 698336 abandoned by Zabe:

[pywikibot/core@master] Move add_text functionality to textlib

Reason:

per comments

https://gerrit.wikimedia.org/r/698336

Change 699333 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [IMPR] add add_text function to textlib

https://gerrit.wikimedia.org/r/699333

Xqt added a subscriber: atagar.

Change 699420 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [cleanup] deprecate get_text, put_text and add_text functions

https://gerrit.wikimedia.org/r/699420

Change 699333 merged by jenkins-bot:

[pywikibot/core@master] [IMPR] add add_text function to textlib

https://gerrit.wikimedia.org/r/699333

Change 699420 merged by Xqt:

[pywikibot/core@master] [cleanup] deprecate get_text, put_text and add_text functions

https://gerrit.wikimedia.org/r/699420