Skip to content

Commit b6b87a5

Browse files
fix magic_underscores in reference pages post-2.0
1 parent 7267d48 commit b6b87a5

File tree

2 files changed

+6812
-6761
lines changed

2 files changed

+6812
-6761
lines changed

_data/get_plotschema.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,19 @@ def make_underscore(path, section, value):
9090

9191

9292
def underscores(attr, path, section):
93-
if attr.get("role", "object") == "object":
94-
if "items" not in attr or (
95-
len(path) > 0 and path[-1] in ["shapes", "annotations", "images"]
96-
):
97-
if "_deprecated" in attr:
98-
del attr["_deprecated"]
99-
for k in attr:
100-
if type(attr[k]) == dict and not k.endswith("src"):
101-
underscores(attr[k], path + [k], section)
102-
if len(path) and path[-1] != "items":
103-
attr["magic_underscores"] = make_underscore(path, section, "dict(...)")
104-
else:
105-
attr["magic_underscores"] = make_underscore(path, section, "list(...)")
106-
elif attr.get("role", None):
93+
if "items" not in attr or (
94+
len(path) > 0 and path[-1] in ["shapes", "annotations", "images"]
95+
):
96+
if "_deprecated" in attr:
97+
del attr["_deprecated"]
98+
for k in attr:
99+
if type(attr[k]) == dict and not k.endswith("src"):
100+
underscores(attr[k], path + [k], section)
101+
else:
102+
attr["magic_underscores"] = make_underscore(path, section, "list(...)")
103+
if attr.get("role") == "object":
104+
attr["magic_underscores"] = make_underscore(path, section, "dict(...)")
105+
else:
107106
attr["magic_underscores"] = make_underscore(path, section, "<VALUE>")
108107

109108

0 commit comments

Comments
 (0)