From 01425fe026ce76e9744e1d19d231d88032c001c7 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 1 Jun 2021 12:19:47 +1000 Subject: [PATCH] Remove commented out getattr failure This code goes into a recursive death loop with Python 3. I'm not sure what it's doing, and it looks unused. Remove it. Change-Id: Ice11c70c91d4d6217a19c302df1867a969535a63 --- MeetBot/plugin.py | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/MeetBot/plugin.py b/MeetBot/plugin.py index 80751ef..aae2121 100644 --- a/MeetBot/plugin.py +++ b/MeetBot/plugin.py @@ -262,47 +262,6 @@ class MeetBot(callbacks.Plugin): pingall = wrap(pingall, [optional('text', None)]) - def __getattr__(self, name): - """Proxy between proper supybot commands and # MeetBot commands. - - This allows you to use MeetBot: - instead of the typical #command version. However, it's disabled - by default as there are some possible unresolved issues with it. - - To enable this, you must comment out a line in the main code. - It may be enabled in a future version. - """ - # First, proxy to our parent classes (__parent__ set in __init__) - try: - return self.__parent.__getattr__(name) - except AttributeError: - pass - # Disabled for now. Uncomment this if you want to use this. - raise AttributeError - - if not hasattr(meeting.Meeting, "do_"+name): - raise AttributeError - - def wrapped_function(self, irc, msg, args, message): - channel = msg.args[0] - payload = msg.args[1] - - #from fitz import interactnow ; reload(interactnow) - - #print type(payload) - payload = "#%s %s"%(name,message) - #print payload - import copy - msg = copy.copy(msg) - msg.args = (channel, payload) - - self.doPrivmsg(irc, msg) - # Give it the signature we need to be a callable supybot - # command (it does check more than I'd like). Heavy Wizardry. - instancemethod = type(self.__getattr__) - wrapped_function = wrap(wrapped_function, [optional('text', '')]) - return instancemethod(wrapped_function, self, MeetBot) - Class = MeetBot