mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Made CommandThread work with non-instancemethods.
This commit is contained in:
parent
e30cf69ec1
commit
5630782e85
@ -342,8 +342,14 @@ class CommandThread(threading.Thread):
|
|||||||
def __init__(self, command, irc, msg, args):
|
def __init__(self, command, irc, msg, args):
|
||||||
self.command = command
|
self.command = command
|
||||||
world.threadsSpawned += 1
|
world.threadsSpawned += 1
|
||||||
|
try:
|
||||||
self.commandName = command.im_func.func_name
|
self.commandName = command.im_func.func_name
|
||||||
|
except AttributeError:
|
||||||
|
self.commandName = command.__name__
|
||||||
|
try:
|
||||||
self.className = command.im_class.__name__
|
self.className = command.im_class.__name__
|
||||||
|
except AttributeError:
|
||||||
|
self.className = '<unknown>'
|
||||||
name = '%s.%s with args %r' % (self.className, self.commandName, args)
|
name = '%s.%s with args %r' % (self.className, self.commandName, args)
|
||||||
threading.Thread.__init__(self, target=command, name=name,
|
threading.Thread.__init__(self, target=command, name=name,
|
||||||
args=(irc, msg, args))
|
args=(irc, msg, args))
|
||||||
|
Loading…
Reference in New Issue
Block a user