minor edit to plugin reloading (dir() -> vars())
This commit is contained in:
parent
b965ec92ab
commit
aead137ed7
7
bot.py
7
bot.py
|
@ -42,10 +42,9 @@ def reload_plugins(mtime=[0]):
|
||||||
shortname = os.path.splitext(os.path.basename(filename))[0]
|
shortname = os.path.splitext(os.path.basename(filename))[0]
|
||||||
try:
|
try:
|
||||||
plugin = imp.load_source(shortname, filename)
|
plugin = imp.load_source(shortname, filename)
|
||||||
for thing in dir(plugin):
|
for obj in vars(plugin).itervalues():
|
||||||
thing = getattr(plugin, thing)
|
if hasattr(obj, '_skybot_hook'): #check for magic
|
||||||
if hasattr(thing, '_skybot_hook'):
|
for type, data in obj._skybot_hook:
|
||||||
for type, data in thing._skybot_hook:
|
|
||||||
bot.plugs[type] += [data]
|
bot.plugs[type] += [data]
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print ' error:', e
|
print ' error:', e
|
||||||
|
|
Loading…
Reference in New Issue