mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Stylistic updates.
This commit is contained in:
parent
4cd70bbdd4
commit
38e8c33422
@ -714,15 +714,17 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
methodName = canonicalName(methodName)
|
methodName = canonicalName(methodName)
|
||||||
return getattr(self, methodName)
|
return getattr(self, methodName)
|
||||||
|
|
||||||
def callCommand(self, f, irc, msg, *L):
|
def callCommand(self, method, irc, msg, *L):
|
||||||
name = f.im_func.func_name
|
name = method.im_func.func_name
|
||||||
assert L, 'Odd, nothing in L. This can\'t happen.'
|
assert L, 'Odd, nothing in L. This can\'t happen.'
|
||||||
self.log.info('Command %s called with args %s by %s',
|
self.log.info('Command %s called with args %s by %s',
|
||||||
name, L[0], msg.prefix)
|
name, L[0], msg.prefix)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
f(irc, msg, *L)
|
method(irc, msg, *L)
|
||||||
except (getopt.GetoptError, ArgumentError, CannotNest):
|
except (getopt.GetoptError, ArgumentError, CannotNest):
|
||||||
|
# Not catching getopt.GetoptError, ArgumentError, CannotNest --
|
||||||
|
# those are handled by IrcObjectProxy.
|
||||||
raise
|
raise
|
||||||
except (SyntaxError, Error), e:
|
except (SyntaxError, Error), e:
|
||||||
self.log.info('Error return: %s', e)
|
self.log.info('Error return: %s', e)
|
||||||
@ -730,8 +732,6 @@ class Privmsg(irclib.IrcCallback):
|
|||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.log.exception('Uncaught exception:')
|
self.log.exception('Uncaught exception:')
|
||||||
irc.error(utils.exnToString(e))
|
irc.error(utils.exnToString(e))
|
||||||
# Not catching getopt.GetoptError, ArgumentError, CannotNest -- those
|
|
||||||
# are handled by IrcObjectProxy.
|
|
||||||
elapsed = time.time() - start
|
elapsed = time.time() - start
|
||||||
self.log.info('%s took %s seconds', name, elapsed)
|
self.log.info('%s took %s seconds', name, elapsed)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user