Add the ability to reload submodule or a module part after a import reload (useful for reload imports of this module)

This commit is contained in:
Némunaire 2012-07-03 04:13:10 +02:00
commit b4b24c4543
6 changed files with 29 additions and 10 deletions

View file

@ -120,6 +120,10 @@ def load_module_from_name(name, servers, config=None):
if md.name == name:
mod = imp.reload(md)
loaded = True
try:
mod.reload()
except AttributeError:
pass
break
if not loaded:
mod = __import__(name)