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

Function main

tools/fromschema.py:558–577  ·  view source on GitHub ↗
(schemafile, markdownfile)

Source from the content-addressed store, hash-verified

556
557
558def main(schemafile, markdownfile):
559 with open(schemafile, 'r') as f:
560 schema = json.load(f)
561
562 name = schema.get('rpc') or schema.get('notification') or schema.get('hook')
563 if name is None:
564 name = os.path.basename(schemafile).replace('.json', '')
565 # Outputs rpc title and synopsis with request parameters
566 generate_header(schema, name)
567 # Outputs command description with request parameter descriptions
568 generate_description(schema)
569 # Outputs other remaining sections before return value section
570 generate_body(schema)
571 # Outputs command response with response parameter descriptions
572 generate_return_value(schema)
573 # Outputs other remaining sections after return value section
574 generate_footer(schema, name)
575
576 if markdownfile is None:
577 return
578
579
580if __name__ == '__main__':

Callers 1

fromschema.pyFile · 0.70

Calls 6

generate_headerFunction · 0.85
generate_descriptionFunction · 0.85
generate_bodyFunction · 0.85
generate_return_valueFunction · 0.85
generate_footerFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected