Import some signatures in incorrect format from Codeberg

This commit is contained in:
Ivanq 2021-03-30 23:00:28 +03:00
parent b970932437
commit ccaa517bfa
8 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,2 @@
name: Ricardo Morte Ferrer
link: mailto:ricardo63@autistici.org

View File

@ -0,0 +1,2 @@
name: Aleksey Kuchkin
link: mailto:stariylis@internet.ru

View File

@ -0,0 +1,2 @@
name: Nilolay Kirillov
link: https://codeberg.org/firgonstelsyou

View File

@ -0,0 +1,2 @@
name: Petr Tonkoshurov
link: mailto:petr@petr.tv

View File

@ -0,0 +1,2 @@
name: David Selivanov
link: mailto:rtmpdavid@gmail.com

View File

@ -0,0 +1,2 @@
name: Mohammad Sameer
link: https://www.mazayait.com

View File

@ -0,0 +1,2 @@
name: Yudha Satya
link: https://codeberg.org/yudhasatya

View File

@ -12,10 +12,24 @@ while True:
content = comment["body"]
content_lines = [line.strip() for line in content.replace("`", "").strip().split("\n") if line.strip()]
imported = False
for i in range(len(content_lines) - 1):
if content_lines[i].lower().startswith("name:") and content_lines[i + 1].lower().startswith("link:"):
if not os.path.isfile(f"_data/signed/{author}.yaml"):
with open(f"_data/signed/{author}.yaml", "w") as f:
f.write("name:" + content_lines[i][5:] + "\nlink:" + content_lines[i + 1][5:] + "\n")
imported = True
if not imported and len(content_lines) == 2:
name, link = content_lines
if name.lower().startswith("name:"):
name = name[5:]
name = name.strip()
if link.lower().startswith("link:"):
link = link[5:]
link = link.strip()
if "/" in link or "@" in link:
if not os.path.isfile(f"_data/signed/{author}.yaml"):
with open(f"_data/signed/{author}.yaml", "w") as f:
f.write(f"name: {name}\nlink: {link}\n")
page += 1