diff --git a/plugins/Alias.py b/plugins/Alias.py index 31c773009..302fb2677 100644 --- a/plugins/Alias.py +++ b/plugins/Alias.py @@ -36,6 +36,7 @@ Allows 'aliases' for other commands. from baseplugin import * import re +import new import sets import conf @@ -144,6 +145,7 @@ def makeNewAlias(name, alias): args = args[biggestDollar:] alias_ = atRe.sub(replace, alias_) self.Proxy(irc.irc, msg, callbacks.tokenize(alias_)) + #f = new.function(f.func_code, f.func_globals, alias) f.__doc__ ='\n\nAlias for %r' % \ (utils.nItems(biggestDollar, 'argument'), alias) #f = new.function(f.func_code, f.func_globals, name) diff --git a/src/privmsgs.py b/src/privmsgs.py index c27ebdbb5..7fab5873d 100644 --- a/src/privmsgs.py +++ b/src/privmsgs.py @@ -83,11 +83,15 @@ def checkCapability(f, capability): f(self, irc, msg, args) else: irc.error(msg, conf.replyNoCapability % capability) + #newf = new.function(newf.func_code, newf.func_globals, f.func_name) newf.__doc__ = f.__doc__ return newf def checkChannelCapability(f, capability): - """Makes sure a user has a certain channel capability before running f.""" + """Makes sure a user has a certain channel capability before running f. + + Do note that you need to add a "channel" argument to your argument list. + """ def newf(self, irc, msg, args, *L): channel = getChannel(msg, args) # Make a copy, f might getChannel. chancap = ircdb.makeChannelCapability(channel, capability) @@ -97,6 +101,7 @@ def checkChannelCapability(f, capability): ff(irc, msg, args, *L) else: irc.error(msg, conf.replyNoCapability % chancap) + #newf = new.function(newf.func_code, newf.func_globals, f.func_name) newf.__doc__ = f.__doc__ return newf @@ -106,6 +111,7 @@ def thread(f): ff = new.instancemethod(f, self, self.__class__) t = callbacks.CommandThread(self.callCommand, ff, irc, msg, args, *L) t.start() + #newf = new.function(newf.func_code, newf.func_globals, f.func_name) newf.__doc__ = f.__doc__ return newf @@ -123,6 +129,7 @@ def name(f): L = (name,) + L ff = new.instancemethod(f, self, self.__class__) ff(irc, msg, args, *L) + #newf = new.function(newf.func_code, newf.func_globals, f.func_name) newf.__doc__ = f.__doc__ return newf @@ -133,6 +140,7 @@ def channel(f): L = (channel,) + L ff = new.instancemethod(f, self, self.__class__) ff(irc, msg, args, *L) + #newf = new.function(newf.func_code, newf.func_globals, f.func_name) newf.__doc__ = f.__doc__ return newf