mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-04-26 09:34:56 +08:00
23 lines
520 B
Python
Executable file
23 lines
520 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
# Copyright © Michal Čihař <michal@weblate.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import re
|
|
import sys
|
|
|
|
version = '[^"]*'
|
|
if len(sys.argv) == 2:
|
|
version = sys.argv[1].replace(".", "-")
|
|
|
|
tag = f'<section id="weblate-{version}">.+?<h1>(.+?)<a(.+?)</a></h1>(.+?)</section>'
|
|
|
|
with open("docs/_build/html/changes.html") as handle:
|
|
data = handle.read()
|
|
|
|
for match in re.findall(tag, data, re.MULTILINE | re.DOTALL):
|
|
print(match[0])
|
|
print()
|
|
print(match[2])
|
|
break
|