Created
June 6, 2011 16:56
-
-
Save FurryHead/1010639 to your computer and use it in GitHub Desktop.
Load list of classes from each module in a package, using exocet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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