File tree 1 file changed +33
-9
lines changed
1 file changed +33
-9
lines changed Original file line number Diff line number Diff line change 71
71
72
72
line = boardstxt .readline ()
73
73
74
-
75
- for p in menuentries :
76
- for q in menuentries [p ]:
77
- menuentries [p ][q ] = menudescs [p ] + ': ' + menuentries [p ][q ]
74
+ # end parsing
75
+ # now formatting
78
76
79
77
for h in hide :
80
78
del menuentries [h ]
81
79
82
- all = collections .OrderedDict ([
83
- ( 'boards' , boards ),
84
- ( 'options' , menudescs ),
85
- ( 'values' , menuentries )
86
- ])
80
+ all = { }
81
+
82
+ all ["options" ] = [ ]
83
+ for entry in menuentries :
84
+ list = [ ]
85
+ for value in menuentries [entry ]:
86
+ subdict = { }
87
+ subdict ["value" ] = value
88
+ subdict ["description" ] = menuentries [entry ][value ]
89
+ list .append (subdict )
90
+ dict = { }
91
+ dict ["values" ] = list
92
+ dict ["ID" ] = entry
93
+ dict ["description" ] = menudescs [entry ]
94
+ all ["options" ].append (dict )
95
+
96
+ all ["menus" ] = [ ]
97
+ for desc in menudescs :
98
+ dict = { }
99
+ dict ["description" ] = menudescs [desc ]
100
+ dict ["ID" ] = desc
101
+ all ["menus" ].append (dict )
102
+
103
+ all ["boards" ] = [ ]
104
+ for board in boards :
105
+ dict = { }
106
+ dict ["description" ] = boards [board ]
107
+ dict ["ID" ] = board
108
+ all ["boards" ].append (dict )
109
+
110
+ # display
87
111
88
112
if args .machine :
89
113
print (json .dumps (all ))
You can’t perform that action at this time.
0 commit comments