9 files = os.listdir(image_path)
12 modules_with_plots = [f[:-4]
for f
in files
if re.match(
r'.*.png', f)]
15 headers = [m.lower() +
'module.h' for m
in modules_with_plots]
17 filename = sys.argv[1]
18 subdirs = filename[len(os.path.abspath(os.curdir)) + 1:].split(os.path.sep)
20 if 'modules' in subdirs:
22 elif 'dataobjects' in subdirs:
23 group +=
'_dataobjects'
27 found_idx = headers.index(os.path.basename(filename).lower())
29 module = modules_with_plots[found_idx]
30 classname = module +
'Module'
35 for line
in open(filename):
37 line = line.replace(
'## ',
'## ')
40 if found_idx
is not None:
42 if re.match(
r'.*class ' + classname +
'.*', line):
45 * \image html ''' + module +
'''.png
48 if re.match(
r'^}.*', line)
and belle2ns:
55 sys.stdout.write(line)
59 if re.match(
r'namespace Belle2 {.*', line):