MCPcopy
hub / github.com/chriskiehl/Gooey / apply_default_rewrites

Function apply_default_rewrites

gooey/python_bindings/argparse_to_json.py:222–233  ·  view source on GitHub ↗
(spec)

Source from the content-addressed store, hash-verified

220
221
222def apply_default_rewrites(spec):
223 top_level_subgroups = list(spec['widgets'].keys())
224
225 for subgroup in top_level_subgroups:
226 path = ['widgets', subgroup, 'contents']
227 contents = getin(spec, path)
228 for group in contents:
229 if group['name'] == 'positional arguments':
230 group['name'] = 'required_args_msg'
231 if group['name'] == 'optional arguments':
232 group['name'] = 'optional_args_msg'
233 return spec
234
235
236def contains_actions(a, b):

Callers 1

convertFunction · 0.85

Calls 1

getinFunction · 0.90

Tested by

no test coverage detected