Page MenuHomePhabricator

Bot vs MultipleSitesBot?
Closed, InvalidPublic

Description

Two of our pywikibot/bot.py classes (Bot and MultipleSitesBot) are functionally near identical and I need some guidance on what we want to do with them...

  • Bot is documented as being for multiple sites, and discouraged in favor of MultipleSitesBot. Its site property is either defined by the constructor or init_page().
  • MultipleSitesBot has a long deprecated site property that is defined by its init_page(). If we remove this property the class doesn't have anything (it's just a BaseBot).

I think we want to...

  1. Deprecate Bot in favor of MultipleSitesBot.
  2. Un-deprecate the MultipleSitesBot site property and keep it because callers need the latest page instance to reference it.

Or maybe we should simply deprecate both classes? I need advise from someone more knowledgeable about what this module aims to provide.

Thanks! -Damian

Event Timeline

Thats not really true. Bot was the first Bot class. Most bots are runnng on only one site but some minor scripts are working on multiple sites. Therefore SingleSiteBot and MultipleSitesBot were introduced and Bot class was repressed. I am not very happy with SingleSiteBot/MultipleSitesBot because the bot's site is not important for a given Page which has the site object with it. On the other hand the API bases on sites and every API call starts with a given site. You have to digg the ideas behind their implemenation. Maybe they are obsolete after such long time and only Bot can be the base class then. But this is minor important for me because there are a lot of open task which are waiting to be solved.

Thanks for the detailed explanation Xqt! I don't have sufficient familiarity with our frameworks usage to determine the best class hierarchy to provide so I'm going to focus elsewhere for now. I might revisit this in the future. In the meantime I'll simply drop the deprecated bit of this module.

Change 693497 had a related patch set uploaded (by Damian; author: Damian):

[pywikibot/core@master] [cleanup] Remove deprecated MultipleSitesBot site attribute

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

Change 693497 merged by jenkins-bot:

[pywikibot/core@master] [cleanup] Remove deprecated MultipleSitesBot site attribute

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