mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Added a canonicalName method to plugins.
This commit is contained in:
parent
c3e1d1daca
commit
c1c46495b3
@ -991,6 +991,12 @@ class Commands(object):
|
|||||||
commandArgs = ['self', 'irc', 'msg', 'args']
|
commandArgs = ['self', 'irc', 'msg', 'args']
|
||||||
# These must be class-scope, so all plugins use the same one.
|
# These must be class-scope, so all plugins use the same one.
|
||||||
_disabled = DisabledCommands()
|
_disabled = DisabledCommands()
|
||||||
|
def name(self):
|
||||||
|
return self.__class__.__name__
|
||||||
|
|
||||||
|
def canonicalName(self):
|
||||||
|
return canonicalName(self.name())
|
||||||
|
|
||||||
def isDisabled(self, command):
|
def isDisabled(self, command):
|
||||||
return self._disabled.disabled(command, self.name())
|
return self._disabled.disabled(command, self.name())
|
||||||
|
|
||||||
@ -1141,6 +1147,9 @@ class PluginMixin(irclib.IrcCallback):
|
|||||||
dispatcher.isDispatcher = True
|
dispatcher.isDispatcher = True
|
||||||
setattr(self.__class__, canonicalname, dispatcher)
|
setattr(self.__class__, canonicalname, dispatcher)
|
||||||
|
|
||||||
|
def canonicalName(self):
|
||||||
|
return canonicalName(self.name())
|
||||||
|
|
||||||
def __call__(self, irc, msg):
|
def __call__(self, irc, msg):
|
||||||
# This is for later dynamic scoping.
|
# This is for later dynamic scoping.
|
||||||
if msg.command == 'PRIVMSG':
|
if msg.command == 'PRIVMSG':
|
||||||
|
Loading…
Reference in New Issue
Block a user