Fix the docs printing sequence

This commit is contained in:
Thomas S Hatch 2011-04-23 16:18:56 -06:00
parent 29d0356e49
commit 4757387f99
2 changed files with 11 additions and 10 deletions

View File

@ -33,16 +33,15 @@ class Caller(object):
''' '''
Pick up the documentation for all of the modules and print it out. Pick up the documentation for all of the modules and print it out.
''' '''
ret = self.loader.call('sys.doc', self.opts['arg']) ret = self.loader.apply_introspection(self.loader.gen_functions())
docs = {} docs = {}
for host in ret: for name in ret:
for fun in ret[host]: if not docs.has_key(name):
if not docs.has_key(fun): if ret[name].__doc__:
if ret[host][fun]: docs[name] = ret[name].__doc__
docs[fun] = ret[host][fun] for name in sorted(docs):
for fun in sorted(docs): print name + ':'
print fun + ':' print docs[name]
print docs[fun]
print '' print ''
def run(self): def run(self):

View File

@ -103,6 +103,8 @@ class Loader(object):
modules = [] modules = []
funcs = {} funcs = {}
for mod_dir in self.module_dirs: for mod_dir in self.module_dirs:
if not mod_dir.startswith('/'):
continue
for fn_ in os.listdir(mod_dir): for fn_ in os.listdir(mod_dir):
if fn_.startswith('_'): if fn_.startswith('_'):
continue continue