MCPcopy Create free account
hub / github.com/bspaans/python-mingus / generate_package_wikidocs

Function generate_package_wikidocs

scripts/api_doc_generator.py:226–252  ·  view source on GitHub ↗
(package_string, file_prefix='ref',
        file_suffix='.wiki')

Source from the content-addressed store, hash-verified

224
225
226def generate_package_wikidocs(package_string, file_prefix='ref',
227 file_suffix='.wiki'):
228 d = Documize()
229 package = eval(package_string)
230 print('\nGenerating documentation for package {0}'.format(package_string))
231 for element in dir(package):
232 if not callable(element) and not element.startswith('__'):
233 fullname = '{0}.{1}'.format(package_string, element)
234 e = eval(fullname)
235 typ = type(eval(fullname))
236 d.set_module(fullname)
237 wikiname = file_prefix
238 for parts in fullname.split('.'):
239 wikiname += parts.capitalize()
240 wikiname += file_suffix
241 print('Writing {0}...'.format(wikiname), end=' ')
242 result = d.output_wiki()
243 try:
244 f = open(os.path.join(sys.argv[1], wikiname), 'w')
245 try:
246 f.write(result)
247 print('OK')
248 except:
249 print("ERROR. Couldn't write to file.")
250 f.close()
251 except:
252 print("ERROR. Couldn't open file for writing.")
253
254
255def main():

Callers 1

mainFunction · 0.85

Calls 3

set_moduleMethod · 0.95
output_wikiMethod · 0.95
DocumizeClass · 0.85

Tested by

no test coverage detected