weblate/scripts/extract-release-notes
Michal Čihař aca77b468c utils: Add support for capturing messages
This removes need for triggering and catching exceptions to report an
error with stack trace.
2023-04-04 13:38:37 +02:00

24 lines
569 B
Python
Executable file

#!/usr/bin/env python3
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
if len(sys.argv) != 2:
raise ValueError("Missing argument")
start = f"Weblate {sys.argv[1]}\n"
display = False
with open("docs/changes.rst") as handle:
for line in handle:
if display:
if line.startswith("Weblate "):
break
elif not line.startswith("--"):
print(line, end="")
elif line == start:
display = True
print(line, end="")