diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-28 16:44:06 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-28 16:44:06 (GMT) |
commit | 08c27487173faf6a86b5fe20e6b545033b6d1638 (patch) | |
tree | 6b412c3c7bd0f7d72ad3c5d20221b740778c63bd /devbot/main.py | |
parent | 542477741abe0135c652a78911a0eb9aec9b1a19 (diff) |
Rework initialization
To avoid duplicatin environ setup calls.
Diffstat (limited to 'devbot/main.py')
-rw-r--r-- | devbot/main.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/devbot/main.py b/devbot/main.py new file mode 100644 index 0000000..3e14a72 --- /dev/null +++ b/devbot/main.py @@ -0,0 +1,18 @@ +import pkgutil +import imp + +from devbot import config +from devbot import environ +from devbot import plugins + + +def load_plugins(): + for loader, name, ispkg in pkgutil.iter_modules(plugins.__path__): + f, filename, desc = imp.find_module(name, plugins.__path__) + imp.load_module(name, f, filename, desc) + + +def setup(config_args): + load_plugins() + config.setup(**config_args) + environ.setup() |