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

Function main

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

Source from the content-addressed store, hash-verified

256
257
258def main(schemafile, markdownfile):
259 start_marker = '[comment]: # (GENERATE-FROM-SCHEMA-START)\n'
260 end_marker = '[comment]: # (GENERATE-FROM-SCHEMA-END)\n'
261
262 if markdownfile is None:
263 with open(schemafile, "r") as f:
264 schema = json.load(f)
265 generate_from_schema(schema)
266 return
267
268 with open(markdownfile, "r") as f:
269 md = f.readlines()
270
271 suppress_output = False
272 for line in md:
273 if line == end_marker:
274 suppress_output = False
275
276 if not suppress_output:
277 print(line, end='')
278
279 if line == start_marker:
280 with open(schemafile, "r") as f:
281 schema = json.load(f)
282 generate_from_schema(schema)
283 suppress_output = True
284
285
286if __name__ == "__main__":

Callers 1

fromschema.pyFile · 0.70

Calls 2

generate_from_schemaFunction · 0.85
loadMethod · 0.80

Tested by

no test coverage detected