Skip to content

Commit 29257f6

Browse files
gmarullkartben
authored andcommitted
doc: extensions: api_overview: improve some comprehensive lists
Some comprehensive lists were hard to read, improve the code a bit so that things make more sense. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 602290e commit 29257f6

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

doc/_extensions/zephyr/api_overview.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
def get_group(innergroup, all_groups):
1515
try:
1616
return [
17-
g
18-
for g in all_groups
19-
if g.get_compounddef()[0].get_id() == innergroup.get_refid()
17+
group
18+
for group in all_groups
19+
if group.get_compounddef()[0].get_id() == innergroup.get_refid()
2020
][0]
2121
except IndexError as e:
2222
raise Exception(f"Unexpected group {innergroup.get_refid()}") from e
@@ -49,15 +49,10 @@ class ApiOverview(SphinxDirective):
4949
def run(self):
5050
groups = parse_xml_dir(self.config.api_overview_doxygen_out_dir + "/xml")
5151

52+
inners = [group.get_compounddef()[0].get_innergroup() for group in groups]
53+
inner_ids = [i.get_refid() for inner in inners for i in inner]
5254
toplevel = [
53-
g
54-
for g in groups
55-
if g.get_compounddef()[0].get_id()
56-
not in [
57-
i.get_refid()
58-
for h in [j.get_compounddef()[0].get_innergroup() for j in groups]
59-
for i in h
60-
]
55+
group for group in groups if group.get_compounddef()[0].get_id() not in inner_ids
6156
]
6257

6358
return [self.generate_table(toplevel, groups)]

0 commit comments

Comments
 (0)