MCPcopy Create free account
hub / github.com/ElementsProject/lightning / generate_body

Function generate_body

tools/fromschema.py:493–507  ·  view source on GitHub ↗

Output sections which should be printed after description and before return value

(schema)

Source from the content-addressed store, hash-verified

491
492
493def generate_body(schema):
494 """Output sections which should be printed after description and before return value"""
495 # Insert extra line between description and next section with this flag
496 first_matching_key = True
497 # Only add a newline if at least there is one body key found
498 body_key_found = False
499 for key in BODY_KEY_SEQUENCE:
500 if key not in schema:
501 continue
502 body_key_found = True
503 output_title(key.replace('_', ' ').upper(), '-', 1 if first_matching_key else 2)
504 first_matching_key = False
505 outputs(schema[key], '\n')
506 if body_key_found:
507 output('\n')
508
509
510def generate_footer(schema, name):

Callers 1

mainFunction · 0.85

Calls 3

output_titleFunction · 0.85
outputsFunction · 0.85
outputFunction · 0.85

Tested by

no test coverage detected