jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/481338 )
Change subject: [bugfix] Drop botirc.py library part ......................................................................
[bugfix] Drop botirc.py library part
- Print a deprecation warning if IRCBot is used within botirc.py - remove irc from requirements.txt and setup.py because it is used by archived script script_wui.py and deprecated library part botirc.py only
Bug: T212627 Bug: T212632 Change-Id: I20e97339afe0ad45722d7128f2a356d1390cfac7 --- M HISTORY.rst M pywikibot/CONTENT.rst M pywikibot/botirc.py M requirements.txt M setup.py 5 files changed, 20 insertions(+), 15 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst index efc98c2..44bd9a5 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,7 @@ Current release ---------------
+* botirc.IRCBot has been dropped * Bugfixes and improvements * Localisation updates
diff --git a/pywikibot/CONTENT.rst b/pywikibot/CONTENT.rst index cd486e8..caced5f 100644 --- a/pywikibot/CONTENT.rst +++ b/pywikibot/CONTENT.rst @@ -16,7 +16,8 @@ +---------------------------+-------------------------------------------------------+ | bot_choice.py | Classes for input_choice | +---------------------------+-------------------------------------------------------+ - | botirc.py | User-interface related functions for building irc bot | + | botirc.py | Deprecated user-interface related functions for | + | | building irc bot | +---------------------------+-------------------------------------------------------+ | config2.py | Module to define and load pywikibot configuration | +---------------------------+-------------------------------------------------------+ diff --git a/pywikibot/botirc.py b/pywikibot/botirc.py index 4ada623..4db2ef1 100644 --- a/pywikibot/botirc.py +++ b/pywikibot/botirc.py @@ -1,9 +1,12 @@ # -*- coding: utf-8 -*- """ -User-interface related functions for building bots. +WARNING: THIS MODULE EXISTS SOLELY TO PROVIDE BACKWARDS-COMPATIBILITY.
-Note: the script requires the Python IRC library -http://python-irclib.sourceforge.net/ +IT MAY BE REMOVED SOON. + +Deprecated user-interface related functions for building bots. + +@note: the script requires the irc library """ # # (C) Balasyum, 2008 @@ -13,14 +16,10 @@ # from __future__ import absolute_import, division, unicode_literals
-# Note: the intention is to develop this module (at some point) into a Bot -# class definition that can be subclassed to create new, functional bot -# scripts, instead of writing each one from scratch. - - import re
import pywikibot +from pywikibot.tools import ModuleDeprecationWrapper
try: from irc.bot import SingleServerIRCBot @@ -37,6 +36,7 @@
_logger = 'botirc' +__all__ = ('IRCBot',)
class IRCBot(pywikibot.Bot, SingleServerIRCBot): @@ -50,9 +50,8 @@ """
# Bot configuration. - # Only the keys of the dict can be passed as init options + # Only the keys of the dict can be passed as keyword arguments # The values are the default values - # Extend this in subclasses! availableOptions = {} # noqa: N815
def __init__(self, site, channel, nickname, server, port=6667, **kwargs): @@ -127,3 +126,11 @@ def on_quit(self, e, cmd): """Ignore quit request.""" pass + + +wrapper = ModuleDeprecationWrapper(__name__) +wrapper._add_deprecated_attr( + 'IRCBot', + replacement_name=('irc.bot.SingleServerIRCBot from irc library ' + 'or EventStreams'), + since='20190509') diff --git a/requirements.txt b/requirements.txt index ec693c7..a07e83a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -52,9 +52,6 @@ # scripts/flickrripper.py flickrapi
-# incomplete core component botirc -irc - # textlib.py and patrol.py mwparserfromhell>=0.3.3
diff --git a/setup.py b/setup.py index e218e90..cdc5bb9 100644 --- a/setup.py +++ b/setup.py @@ -51,7 +51,6 @@ 'isbn': ['python-stdnum'], 'Graphviz': ['pydot>=1.2'], 'Google': ['google>=1.7'], - 'IRC': ['irc'], 'mwparserfromhell': ['mwparserfromhell>=0.3.3'], 'Tkinter': [pillow], 'security': ['requests[security]', 'pycparser!=2.14'],
pywikibot-commits@lists.wikimedia.org