lehmannro / pyhkal2

IRC bot with bling bling
7 stars 2 forks source link

TypeError in QuakeNet module #15

Closed lehmannro closed 14 years ago

lehmannro commented 14 years ago
File "contrib/quakenet.py", line 29, in findIdentities
   if hasattr(nickdb[nickname], 'identity') and isinstance(nickdb[nickname], Identity):
exceptions.TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and types

Apart from the obvious flaws in this code snippet Identity should indeed be a class.

lehmannro commented 14 years ago

Fixed in 457a2b0ef0849f567b07f26207497ae75dfb49f0. Exposing Identity as a class is a wholly different beast and not as trivial as it sounds; it needs to record the service it is linked to (a pyhkal.Pyhkal instance) for calls to emit et al. Perhaps pyhkal.shrink should grow into a module (that is, contrib plugin).