brie-aurore/Brie/brie/lib/plugins_loader.py
2013-09-14 00:23:28 +02:00

18 lines
516 B
Python

class PluginsPackage:
def __init__(self, controllers_dict):
self.__dict__ = controllers_dict
#end class
def load():
plugins_import = __import__("brie.plugins")
controllers_dict = dict()
for sub_package in plugins_import.plugins.__all__:
controller_import = __import__("brie.plugins." + sub_package + ".controller")
controllers_dict[sub_package] = controller_import.plugins.__dict__[sub_package].controller
#end for
return PluginsPackage(controllers_dict)
#end def