diff --git a/src/callbacks.py b/src/callbacks.py index 64fac300a..d2d6ba4b9 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -1036,11 +1036,20 @@ class BasePlugin(object): cb.log = log.getPluginLogger('%s.%s' % (self.name(),cb.name())) super(BasePlugin, self).__init__(*args, **kwargs) +class SynchronizedAndFirewalled(log.MetaFirewall, utils.python.Synchronized): + pass # Necessary for the metaclass compatibility issue. + class Commands(BasePlugin): # For awhile, a comment stood here to say, "Eventually callCommand." But # that's wrong, because we can't do generic error handling in this # callCommand -- plugins need to be able to override callCommand and do # error handling there (see the Http plugin for an example). + __metaclass__ = SynchronizedAndFirewalled + __synchronized__ = ( + '__call__', + 'callCommand', + 'invalidCommand', + ) __firewalled__ = {'isCommand': None, '_callCommand': None} commandArgs = ['self', 'irc', 'msg', 'args'] @@ -1049,6 +1058,9 @@ class Commands(BasePlugin): def name(self): return self.__class__.__name__ + def __call__(self, *args, **kwargs): + super(Commands, self).__call__(*args, **kwargs) + def canonicalName(self): return canonicalName(self.name())