weblate/scripts/extract-release-notes
Michal Čihař 6f089bb4d7 Lint: Introcude pyupgrade to pre-commit
It pushes modern Python syntax.
2020-11-20 13:40:06 +01:00

20 lines
478 B
Python
Executable file

#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
raise Exception("Missing argument")
start = "Weblate {}\n".format(sys.argv[1])
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="")