From 9adb0cfbf5ee152ca3be75f27f17d8b1efcd3cce Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Tue, 25 May 2021 08:43:49 +0200 Subject: [PATCH] Update lob --- library-of-babel.org | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/library-of-babel.org b/library-of-babel.org index 1aa99437..1b675a64 100644 --- a/library-of-babel.org +++ b/library-of-babel.org @@ -1,7 +1,7 @@ # Created 2021-04-29 Thu 09:07 #+TITLE: The Library of Babel #+AUTHOR: Org-mode People -#+startup: hideblocks + * Introduction @@ -642,7 +642,7 @@ this default behavior. Below is a list of such options: for entry in entries]) for k,v in feeds.items(): - print(f'{k}\n{v}\n') + print(f'\n{k}\n{v}\n') if __name__ == '__main__': @@ -655,3 +655,24 @@ this default behavior. Below is a list of such options: from tabulate import tabulate return f"return tabulate({df}, headers={df}.columns, tablefmt='orgtbl')" #+end_src +** Contributing to git + #+begin_src python :results output drawer :exports results + import os + from git import Repo + + repo = Repo(os.path.abspath('.')) + + def org_list(l: list) -> list: + return [f"\n- {i}\n" for i in l] + + def unique(l: list) -> list: + return sorted(set(l)) + + def authors(commits: list) -> list: + return [f"{i.author.name} <{i.author.email}>" for i in commits] + + def commits(repo: Repo) -> list: + return list(repo.iter_commits("master")) + + print(*org_list(unique(authors(commits(repo))))) + #+end_src