diff options
author | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2008-10-02 17:49:54 -0400 |
---|---|---|
committer | Yaakov M. Nemoy <loupgaroublond@gmail.com> | 2008-10-02 17:49:54 -0400 |
commit | 11637a914ab5875d65531a669609f7002092bc99 (patch) | |
tree | d88da21264ad764f5584049757791ceedab096b4 | |
parent | ea2c26d98ea1602b678ce2ad7ac5bdf5eed995fe (diff) | |
download | fedora-devshell-11637a914ab5875d65531a669609f7002092bc99.tar.gz fedora-devshell-11637a914ab5875d65531a669609f7002092bc99.tar.xz fedora-devshell-11637a914ab5875d65531a669609f7002092bc99.zip |
Better module detection
-rw-r--r-- | base/base.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/base/base.py b/base/base.py index 214d1d5..68677bc 100644 --- a/base/base.py +++ b/base/base.py @@ -3,7 +3,7 @@ import os from inspect import isclass from collections import deque -from os.path import join +from os.path import join, dirname from module import Module @@ -36,9 +36,10 @@ def print_docstrings(module=None): def load_modules(): global modules + import modules as mods log.debug("Loading modules") #TODO: better way to find modules - for f in os.listdir(os.path.abspath('modules')): + for f in os.listdir(dirname(mods.__file__)): module_name, ext = os.path.splitext(f) if ext == '.py': exec "from modules import %s as module" % module_name |