17 image_path =
'build/module_io'
19 if os.path.isdir(image_path):
20 files = os.listdir(image_path)
23 modules_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]
26 headers = [m.lower() +
'module.h' for m
in modules_with_plots]
28 filename = sys.argv[1]
29 subdirs = os.path.relpath(filename).split(os.path.sep)
31 if 'modules' in subdirs:
33 elif 'dataobjects' in subdirs:
34 group +=
'_dataobjects'
38 found_idx = headers.index(os.path.basename(filename).lower())
40 module = modules_with_plots[found_idx]
41 classname = module +
'Module'
46 for line
in open(filename):
50 line = line.replace(
'## ',
'## ')
55 if found_idx
is not None:
57 if re.match(
r'.*class ' + classname +
'.*', line):
60 * \\image html ''' + module +
'''.png
65 if re.match(
r'^}.*', line)
and belle2ns:
74 sys.stdout.write(line)
80 if re.match(
r'namespace Belle2 {.*', line):