16image_path =
'build/module_io'
18if os.path.isdir(image_path):
19 files = os.listdir(image_path)
22modules_with_plots = [f[:-4]
for f
in files
if re.match(
r'.*.png', f)
and os.stat(os.path.join(image_path, f)).st_size > 0]
25headers = [m.lower() +
'module.h' for m
in modules_with_plots]
28subdirs = os.path.relpath(filename).split(os.path.sep)
30if 'modules' in subdirs:
32elif 'dataobjects' in subdirs:
33 group +=
'_dataobjects'
37 found_idx = headers.index(os.path.basename(filename).lower())
39 module = modules_with_plots[found_idx]
40 classname = module +
'Module'
45for line
in open(filename):
49 line = line.replace(
'## ',
'## ')
54 if found_idx
is not None:
56 if re.match(
r'.*class ' + classname +
'.*', line):
59* \\image html ''' + module +
'''.png
64 if re.match(
r'^}.*', line)
and belle2ns:
73 sys.stdout.write(line)
79 if re.match(
r'namespace Belle2 {.*', line):