mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +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']
|
||||
# These must be class-scope, so all plugins use the same one.
|
||||
_disabled = DisabledCommands()
|
||||
def name(self):
|
||||
return self.__class__.__name__
|
||||
|
||||
def canonicalName(self):
|
||||
return canonicalName(self.name())
|
||||
|
||||
def isDisabled(self, command):
|
||||
return self._disabled.disabled(command, self.name())
|
||||
|
||||
@ -1141,6 +1147,9 @@ class PluginMixin(irclib.IrcCallback):
|
||||
dispatcher.isDispatcher = True
|
||||
setattr(self.__class__, canonicalname, dispatcher)
|
||||
|
||||
def canonicalName(self):
|
||||
return canonicalName(self.name())
|
||||
|
||||
def __call__(self, irc, msg):
|
||||
# This is for later dynamic scoping.
|
||||
if msg.command == 'PRIVMSG':
|
||||
|
Loading…
Reference in New Issue
Block a user