''

def __init__(self, code_dir='lib'):

    def __load(module_path, d):
        module_pattern = join(join(getcwd(), code_dir, *module_path.split('.')), '*.py')
        for file in glob(module_pattern):
            if basename(file).startswith('_'):
                continue
            module_name = ('%s.%s' % (module_path, basename(file).rsplit('.py', 1)[0]))
            module = __import__(module_name)
            for comp in module_name.split('.')[1:]:
                module = getattr(module, comp)
            for name in module.__all__:
                try:
                    d[name] = getattr(module, name)
                except TypeError:
                    raise TypeError(('Invalid    type    for    name    %s' % name))
    self.cli_shells = {}
    self.cli_job_interfaces = {}
    self.active_cli_shells = {}
    module_prefix = self.__module__
    __load(('%s.shell' % module_prefix), self.cli_shells)
    __load(('%s.job' % module_prefix), self.cli_job_interfaces)
