32 changed files with 121 additions and 46 deletions
@ -0,0 +1,2 @@ |
|||
name: Rupert Falcon Kavanagh ( Claverhouse ) |
|||
link: mailto:claverhouse@tutanota.de |
@ -0,0 +1,2 @@ |
|||
name: Denis Avksentev |
|||
link: https://dribbble.com/Dench |
@ -0,0 +1,2 @@ |
|||
name: Echedey López Romero |
|||
link: https://git.disroot.org/ELR |
@ -0,0 +1,2 @@ |
|||
name: Kaced Sofiane |
|||
link: mailto:kaced.sofiane@gmail.com |
@ -0,0 +1,2 @@ |
|||
name: jagadees, india. |
|||
link: https://neritam.com |
@ -0,0 +1,2 @@ |
|||
name: Joe Serpe |
|||
link: https://simplemachines.it |
@ -0,0 +1,2 @@ |
|||
name: 郝歌 |
|||
link: https://blog.hiddenharmonies.org/ |
@ -0,0 +1,2 @@ |
|||
name: Mike Safonov |
|||
link: https://github.com/MikeSafonov |
@ -0,0 +1,2 @@ |
|||
name: MrClon |
|||
link: https://lor.sh/@MrClon |
@ -0,0 +1,2 @@ |
|||
name: Petr Beliaev |
|||
link: https://github.com/User330639 |
@ -0,0 +1,2 @@ |
|||
name: Dominic Westreicher |
|||
link: mailto:d.westreicher@gmail.com |
@ -0,0 +1,2 @@ |
|||
name: Nei S. |
|||
link: https://nei.su |
@ -0,0 +1,2 @@ |
|||
name: Eryk Michalak (ewm) |
|||
link: https://ewm.codeberg.page/ |
@ -0,0 +1,2 @@ |
|||
name: Marco van Hulten (FSF associate member) |
|||
link: http://marcovan.hulten.org/ |
@ -0,0 +1,2 @@ |
|||
name: if7 |
|||
link: https://libreboot.org/ |
@ -0,0 +1,2 @@ |
|||
name: jakot |
|||
link: https://gitlab.com/jakot |
@ -0,0 +1,2 @@ |
|||
name: Pankaj Jangid (Emacs Developer) |
|||
link: https://codeisgreat.org/ |
@ -0,0 +1,2 @@ |
|||
name: Jose A Ortega Ruiz (FSF Associate Member, GNU MDK) |
|||
link: https://codeberg.org/jao |
@ -0,0 +1,2 @@ |
|||
name: Martin Krischik |
|||
link: https://github.com/krischik |
@ -0,0 +1,2 @@ |
|||
name: kriztolized |
|||
link: mailto:kriztolized@gmail.com |
@ -0,0 +1,2 @@ |
|||
name: Leonardo Ascione |
|||
link: https://github.com/leonardfactory |
@ -0,0 +1,2 @@ |
|||
name: Evgeniy B. |
|||
link: https://github.com/lospirit |
@ -0,0 +1,2 @@ |
|||
name: Tinko Svrakov |
|||
link: mailto:manul91@abv.bg |
@ -0,0 +1,2 @@ |
|||
name: Matthew Cashman |
|||
link: mailto:cashman@mit.edu |
@ -0,0 +1,2 @@ |
|||
name: Neil Haskins |
|||
link: https://neilhaskins.ca |
@ -0,0 +1,2 @@ |
|||
name: Nathan Follens (GNOME Foundation member) |
|||
link: https://l10n.gnome.org/users/nathan/ |
@ -0,0 +1,2 @@ |
|||
name: Dmitry M |
|||
link: https://github.com/shtrih |
@ -0,0 +1,2 @@ |
|||
name: Kyal Smith, South Africa |
|||
link: mailto:kyal.smith@gmail.com |
@ -0,0 +1,60 @@ |
|||
import os |
|||
|
|||
|
|||
def save_signature(name, link, author): |
|||
with open(f"_data/signed/{author}.yaml", "w") as f: |
|||
f.write(f"name: {name.strip()}\nlink: {link.strip()}\n") |
|||
|
|||
|
|||
def parse_and_import_signature(content, author): |
|||
if os.path.isfile(f"_data/signed/{author}.yaml"): |
|||
return |
|||
|
|||
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:"): |
|||
save_signature(content_lines[i][5:], content_lines[i + 1][5:], author) |
|||
imported = True |
|||
|
|||
# Apparently most people can't follow a two-line template, e.g. miss 'name:' |
|||
# or 'link:' or use 'site:' instead of 'link:' or use 'mailto:' instead of |
|||
# 'link: mailto:', etc., so we have to guess in what way their |
|||
# interpretation is wrong, and try to make the format at least somewhat |
|||
# correct. |
|||
if not imported and len(content_lines) == 2: |
|||
name, link = content_lines |
|||
|
|||
if name.lower().startswith("name:"): |
|||
name = name[5:] |
|||
|
|||
if link.lower().startswith("link:"): |
|||
link = link[5:] |
|||
elif link.lower().startswith("site:"): |
|||
link = link[5:] |
|||
elif link.lower().startswith("mail:"): |
|||
link = "mailto:" + link[5:].strip() |
|||
elif link.lower().startswith("email:"): |
|||
link = "mailto:" + link[6:].strip() |
|||
elif link.lower().startswith("mailto:"): |
|||
link = "mailto:" + link[7:].strip() |
|||
|
|||
# Demangle email |
|||
if "@" in link or "(at)" in link or "[at]" in link: |
|||
link = link.replace("[at]", "@") |
|||
link = link.replace("(at)", "@") |
|||
link = link.replace(" at ", "@") |
|||
link = link.replace("[dot]", ".") |
|||
link = link.replace("(dot)", ".") |
|||
link = link.replace(" dot ", ".") |
|||
link = link.replace(" ", "") |
|||
|
|||
# Add protocol to links without it |
|||
if "@" in link: |
|||
if not link.startswith("mailto:"): |
|||
link = f"mailto:{link}" |
|||
elif link.startswith("www.") or link.endswith(".com"): |
|||
link = f"https://{link}" |
|||
|
|||
if "/" in link or "@" in link: |
|||
save_signature(name, link, author) |
Loading…
Reference in new issue