mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-22 18:14:41 +01:00
Fixed some uselessness in log.MetaFirewall and removed an attribute that shouldn't be firewalled (it was vestigial).
This commit is contained in:
parent
44c2f08638
commit
2861b5a334
@ -75,7 +75,9 @@ class IrcCallback(IrcCommandDispatcher):
|
|||||||
'__lt__': lambda self: 0,
|
'__lt__': lambda self: 0,
|
||||||
'inFilter': lambda self, irc, msg: msg,
|
'inFilter': lambda self, irc, msg: msg,
|
||||||
'outFilter': lambda self, irc, msg: msg,
|
'outFilter': lambda self, irc, msg: msg,
|
||||||
'name': lambda self: self.__class__.__name__,}
|
'name': lambda self: self.__class__.__name__,
|
||||||
|
'callPrecedence': lambda self, irc: ([], []),
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(IrcCallback, self).__init__(*args, **kwargs)
|
super(IrcCallback, self).__init__(*args, **kwargs)
|
||||||
|
14
src/log.py
14
src/log.py
@ -331,18 +331,14 @@ def firewall(f, errorHandler=None):
|
|||||||
class MetaFirewall(type):
|
class MetaFirewall(type):
|
||||||
def __new__(cls, name, bases, dict):
|
def __new__(cls, name, bases, dict):
|
||||||
firewalled = {}
|
firewalled = {}
|
||||||
for base in bases:
|
|
||||||
if hasattr(base, '__firewalled__'):
|
|
||||||
firewalled.update(base.__firewalled__)
|
|
||||||
if '__firewalled__' in dict:
|
if '__firewalled__' in dict:
|
||||||
firewalled.update(dict['__firewalled__'])
|
firewalled.update(dict['__firewalled__'])
|
||||||
for attr in firewalled:
|
for attr in firewalled:
|
||||||
if attr in dict:
|
try:
|
||||||
try:
|
errorHandler = firewalled[attr]
|
||||||
errorHandler = firewalled[attr]
|
except:
|
||||||
except:
|
errorHandler = None
|
||||||
errorHandler = None
|
dict[attr] = firewall(dict[attr], errorHandler)
|
||||||
dict[attr] = firewall(dict[attr], errorHandler)
|
|
||||||
return super(MetaFirewall, cls).__new__(cls, name, bases, dict)
|
return super(MetaFirewall, cls).__new__(cls, name, bases, dict)
|
||||||
#return type.__new__(cls, name, bases, dict)
|
#return type.__new__(cls, name, bases, dict)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user