Skip to content

Instantly share code, notes, and snippets.

@FurryHead
Created June 6, 2011 16:56
Show Gist options
  • Save FurryHead/1010639 to your computer and use it in GitHub Desktop.
Save FurryHead/1010639 to your computer and use it in GitHub Desktop.
Load list of classes from each module in a package, using exocet
import exocet
import inspect
PluginList = { }
modules = [m for m in exocet.getModule("plugins").iterModules()]
for module in modules:
m = module.load()
for name, obj in inspect.getmembers(m):
if inspect.isclass(obj):
print "Name = "+name+" --- Obj = "+repr(obj)
PluginList[name] = obj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment