]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Backers file updated
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 4 Dec 2020 04:33:28 +0000 (04:33 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 4 Dec 2020 04:33:28 +0000 (04:33 +0000)
Added scripts to help maintaining it.

.gitignore
BACKERS.md
tools/add_backer.py [new file with mode: 0755]

index b8fb5f22d0375fae90bc53f4e55de6133f5c15fc..ce3d2e05125e9da4de687e07e1acfcb0011c4056 100644 (file)
@@ -8,3 +8,4 @@
 __pycache__/
 /docs/_build/
 /docs/.venv/
+*.html
index 2ca327232aeaae485250da697b0e6b08086fc169..420b2792bf7aebdda6f9c4de473c948a3954268b 100644 (file)
@@ -7,4 +7,16 @@ Thank you very much for supporting the project!
 
 ## Github Sponsors
 
-<a href="https://github.com/taifu"><img src="https://avatars2.githubusercontent.com/u/115712?s=88&v=4" title="Marco Beri" width="60" height="60"></a>
+<a href="https://github.com/gporcari"><img src="https://avatars2.githubusercontent.com/u/601732?v=4" title="Giovanni Porcari" width="100" height="100" style="border-radius: 50%"></a>
+<a href="https://github.com/svennek"><img src="https://avatars3.githubusercontent.com/u/37837?v=4" title="Svenne Krap" width="100" height="100" style="border-radius: 50%"></a>
+<a href="https://github.com/pontikos"><img src="https://avatars3.githubusercontent.com/u/3852020?v=4" title="Nikolas Pontikos" width="100" height="100" style="border-radius: 50%"></a>
+<a href="https://github.com/jdatcmd"><img src="https://avatars0.githubusercontent.com/u/330373?v=4" title="Joshua D. Drake" width="100" height="100" style="border-radius: 50%"></a>
+
+<a href="https://github.com/taifu"><img src="https://avatars1.githubusercontent.com/u/115712?v=4" title="Marco Beri" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/la-mar"><img src="https://avatars0.githubusercontent.com/u/16618300?v=4" title="Brock Friedrich" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/xarg"><img src="https://avatars2.githubusercontent.com/u/94721?v=4" title="Alex Plugaru" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/rafmagns-skepa-dreag"><img src="https://avatars0.githubusercontent.com/u/7447491?v=4" title="Richard H" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/rustprooflabs"><img src="https://avatars0.githubusercontent.com/u/3085224?v=4" title="Ryan Lambert" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/asqui"><img src="https://avatars3.githubusercontent.com/u/174182?v=4" title="Daniel Fortunov" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/iqbalabd"><img src="https://avatars2.githubusercontent.com/u/14254614?v=4" title="Iqbal Abdullah" width="60" height="60" style="border-radius: 50%"></a>
+<a href="https://github.com/c-rindi"><img src="https://avatars2.githubusercontent.com/u/7826876?v=4" title="C~+" width="60" height="60" style="border-radius: 50%"></a>
diff --git a/tools/add_backer.py b/tools/add_backer.py
new file mode 100755 (executable)
index 0000000..4804049
--- /dev/null
@@ -0,0 +1,64 @@
+#!/usr/bin/env python3
+r"""Add a github user to the backers file
+
+Print the tag to represent an user.
+
+Hint: to reprocess the list of users you can use:
+
+    grep "github.com.*100" BACKERS.md \
+        | sed 's|\(.*github.com/\)\([^"]\+\)\(.*\)|\2|' \
+        | xargs ./tools/add_backer.py --big
+
+    grep "github.com.*60" BACKERS.md \
+        | sed 's|\(.*github.com/\)\([^"]\+\)\(.*\)|\2|' \
+        | xargs ./tools/add_backer.py
+"""
+
+import sys
+import html
+import logging
+import requests
+
+logger = logging.getLogger()
+logging.basicConfig(
+    level=logging.INFO,
+    format='%(asctime)s %(levelname)s %(message)s')
+
+
+def main():
+    opt = parse_cmdline()
+    tags = []
+    for username in opt.username:
+        logger.info("fetching %s", username)
+        resp = requests.get(
+            f"https://api.github.com/users/{username}",
+            headers={"Accept": "application/vnd.github.v3+json"},
+        )
+        size = 100 if opt.big else 60
+        resp.raise_for_status()
+        data = resp.json()
+        tags.append(
+            f"""<a href="{data['html_url']}">"""
+            f"""<img src="{data['avatar_url']}" """
+            f"""title="{html.escape(data['name'])}" """
+            f"""width="{size}" height="{size}" """
+            f"""style="border-radius: 50%"></a>"""
+        )
+    for tag in tags:
+        print(tag)
+
+
+def parse_cmdline():
+    from argparse import ArgumentParser
+
+    parser = ArgumentParser(description=__doc__)
+    parser.add_argument("username", nargs="*", help="github user to add")
+    parser.add_argument("--big", action="store_true", help="make them larger")
+
+    opt = parser.parse_args()
+
+    return opt
+
+
+if __name__ == "__main__":
+    sys.exit(main())