MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / __init__

Method __init__

PythonAPI/docs/doc_gen.py:387–405  ·  view source on GitHub ↗
(self, path)

Source from the content-addressed store, hash-verified

385 """Main documentation class"""
386
387 def __init__(self, path):
388 self._path = path
389 self._files = [f for f in os.listdir(path) if f.endswith('.yml')]
390 self._yamls = list()
391 for yaml_file in self._files:
392 self._yamls.append(YamlFile(os.path.join(path, yaml_file)))
393 # Merge same modules of different files
394 self.master_dict = dict()
395 for yaml_file in self._yamls:
396 for module in yaml_file.get_modules():
397 module_name = module['module_name']
398 if module_name not in self.master_dict:
399 self.master_dict[module_name] = module
400 elif valid_dic_val(module, 'classes'):
401 for new_module in module['classes']:
402 # Create the 'classes' key if does not exist already
403 if not valid_dic_val(self.master_dict[module_name], 'classes'):
404 self.master_dict[module_name]['classes'] = []
405 self.master_dict[module_name]['classes'].append(new_module)
406
407 def gen_overview(self):
408 """Generates a referenced index for markdown file"""

Callers

nothing calls this directly

Calls 4

YamlFileClass · 0.85
get_modulesMethod · 0.80
valid_dic_valFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected