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

Method write

tools/generate-wire.py:523–546  ·  view source on GitHub ↗
(self, options, output)

Source from the content-addressed store, hash-verified

521 self.types[tlv_name].mark_tlv(tlv)
522
523 def write(self, options, output):
524 template = self.find_template(options)
525 enum_sets = []
526 if len(self.messages.values()) != 0:
527 enum_sets.append({
528 'name': options.enum_name,
529 'set': self.messages.values(),
530 })
531 stuff = {}
532 stuff['top_comments'] = self.top_comments
533 stuff['options'] = options
534 stuff['idem'] = re.sub(r'[^A-Z0-9]+', '_', options.header_filename.upper())
535 stuff['header_filename'] = options.header_filename
536 stuff['includes'] = self.inclusions
537 stuff['enum_sets'] = enum_sets
538 subtypes = self.get_ordered_subtypes()
539 stuff['structs'] = subtypes + self.tlv_structs()
540 stuff['tlvs'] = self.tlvs
541
542 stuff['messages'] = list(self.messages.values())
543 stuff['subtypes'] = subtypes
544
545 for line in template.render(**stuff).splitlines():
546 print(line.rstrip(), file=output)
547
548
549def main(options, args=None, output=sys.stdout, lines=None):

Calls 4

find_templateMethod · 0.95
get_ordered_subtypesMethod · 0.95
tlv_structsMethod · 0.95
subMethod · 0.80