MCPcopy Create free account
hub / github.com/apache/solr / write_entry

Method write_entry

dev-tools/scripts/changes2logchange.py:613–635  ·  view source on GitHub ↗

Write a single entry to a YAML file.

(entry: ChangeEntry, slug: str, output_dir: Path)

Source from the content-addressed store, hash-verified

611
612 @staticmethod
613 def write_entry(entry: ChangeEntry, slug: str, output_dir: Path):
614 """Write a single entry to a YAML file."""
615 # Ensure output directory exists
616 output_dir.mkdir(parents=True, exist_ok=True)
617
618 filename = f"{slug}.yml"
619 filepath = output_dir / filename
620
621 # Convert entry to dictionary and write as YAML
622 entry_dict = entry.to_dict()
623
624 with open(filepath, 'w', encoding='utf-8') as f:
625 # Use custom YAML dumper for better formatting
626 yaml.dump(
627 entry_dict,
628 f,
629 default_flow_style=False,
630 sort_keys=False,
631 allow_unicode=True,
632 width=80 # Line width for better readability
633 )
634
635 return filepath
636
637
638class ReleaseDate:

Callers 1

_process_versionMethod · 0.80

Calls 2

dumpMethod · 0.80
to_dictMethod · 0.45

Tested by

no test coverage detected