Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module_name = path.basename(fp)
if isdir:
fp = path.join(fp, '__init__.py')
else:
module_name, _ = path.splitext(module_name)
# Use a special module name to avoid import conflicts.
# It is hidden from view via the `Module` class.
with open(fp) as f:
module = imp.load_source('__pdoc_file_module__', fp, f)
if isdir:
module.__path__ = [path.realpath(args.module_name)]
module.__pdoc_module_name = module_name
else:
module = pdoc.import_module(args.module_name)
module = pdoc.Module(module, docfilter=docfilter,
allsubmodules=args.all_submodules)
# Plain text?
if not args.html and not args.all_submodules:
output = module.text()
try:
print(output)
except IOError as e:
# This seems to happen for long documentation.
# This is obviously a hack. What's the real cause? Dunno.
if e.errno == 32:
pass
else:
raise e
sys.exit(0)
except Exception:
pass
raise
for submodule in m.submodules():
# print submodule.name
html_out(submodule, html_dir, html)
# root = os.path.dirname(honeybee.__file__)
# with open(os.path.join(root, '__init__.py'), 'wb') as init:
# init.write('__all__ = ["config"]')
# init.write('__all__ = [%s]' % ','.join(listdir(root)))
html_dir = r'C:\Users\Mostapha\Documents\code\ladybug-tools\honeybee\doc'
module = pdoc.Module(honeybee, docfilter=None, allsubmodules=True)
html_out(module, html_dir)
def main():
for m in documented_sdk_modules:
html = pdoc.html(m, allsubmodules=True)
with open(module_to_docpath(m), 'w') as f:
f.write(html)
import mycroft
mycroft.__all__ = [m[8:] for m in documented_sdk_modules]
root_module = pdoc.Module(mycroft)
html = root_module.html(external_links=False, link_prefix='', source=True)
with open(module_to_docpath("mycroft"), 'w') as f:
f.write(html)