diff options
author | John Eckersberg <jeckersb@redhat.com> | 2008-01-27 17:46:14 -0500 |
---|---|---|
committer | John Eckersberg <jeckersb@redhat.com> | 2008-01-27 17:46:14 -0500 |
commit | 795ceeca5b8f62a0e9d370f083f317ebda1f7d57 (patch) | |
tree | 443154f05c37da429f6f004526f5a8c48bebfe77 /func/minion/module_loader.py | |
parent | 16fa763ad4af4dff50ec50339614ac8a592e8590 (diff) | |
download | func-795ceeca5b8f62a0e9d370f083f317ebda1f7d57.tar.gz func-795ceeca5b8f62a0e9d370f083f317ebda1f7d57.tar.xz func-795ceeca5b8f62a0e9d370f083f317ebda1f7d57.zip |
Load classes under __init__ objects to break this down some more
Diffstat (limited to 'func/minion/module_loader.py')
-rwxr-xr-x | func/minion/module_loader.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/func/minion/module_loader.py b/func/minion/module_loader.py index 37bc515..3068ea8 100755 --- a/func/minion/module_loader.py +++ b/func/minion/module_loader.py @@ -32,9 +32,6 @@ def module_walker(topdir): for filename in files: # ASSUMPTION: all module files will end with .py, .pyc, .pyo if filename[-3:] == ".py" or filename[-4:] == ".pyc" or filename[-4:] == ".pyo": - # we don't really care about __init__ files, though we do requure them - if filename[:8] == "__init__": - continue # the normpath is important, since we eventually replace /'s with .'s # in the module name, and foo..bar doesnt work -akl module_files.append(os.path.normpath("%s/%s" % (root, filename))) @@ -59,9 +56,10 @@ def load_modules(blacklist=None): module_name_part = fn[len(module_file_path):] dirname, basename = os.path.split(module_name_part) - if basename == "__init__.py": - continue - if basename[-3:] == ".py": + if basename[:8] == "__init__": + modname = dirname + dirname = "" + elif basename[-3:] == ".py": modname = basename[:-3] elif basename[-4:] in [".pyc", ".pyo"]: modname = basename[:-4] |