@@ -90,20 +90,19 @@ def make_underscore(path, section, value):
9090
9191
9292def 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