@@ -91,18 +91,20 @@ def make_underscore(path, section, value):
9191
9292def underscores (attr , path , section ):
9393 if "items" not in attr or (
94- len (path ) > 0 and path [- 1 ] in ["shapes" , "annotations" , "images" ]
94+ len (path ) > 0 and path [0 ] in ["shapes" , "annotations" , "images" ]
9595 ):
9696 if "_deprecated" in attr :
9797 del attr ["_deprecated" ]
9898 for k in attr :
9999 if type (attr [k ]) == dict and not k .endswith ("src" ):
100100 underscores (attr [k ], path + [k ], section )
101- if attr .get ("role" ) == "object" :
102- attr ["magic_underscores" ] = make_underscore (path , section , "dict(...)" )
103- else :
104- attr ["magic_underscores" ] = make_underscore (path , section , "<VALUE>" )
105- else :
101+
102+ if len (path ) == 0 or path [- 1 ] != "items" :
103+ if attr .get ("role" ) == "object" :
104+ attr ["magic_underscores" ] = make_underscore (path , section , "dict(...)" )
105+ else :
106+ attr ["magic_underscores" ] = make_underscore (path , section , "<VALUE>" )
107+ elif len (path ) == 0 or path [- 1 ] != "items" :
106108 attr ["magic_underscores" ] = make_underscore (path , section , "list(...)" )
107109
108110
0 commit comments