From 65e89482022c4e249219af165967a856d5837338 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 17 Oct 2021 15:47:37 +0200 Subject: [PATCH] Filter out the whitepapers I have in my libary --- caliGraph.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/caliGraph.py b/caliGraph.py index 1c9cedd..31cb904 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -119,6 +119,13 @@ def removePriv(G): if 'priv' in node['tags']: G.remove_node(n) +def removeWhitepapers(G): + for n in list(G.nodes): + node = G.nodes[n] + if node['t'] == 'book': + if 'whitepaper' in node['tags']: + G.remove_node(n) + def removeDangling(G, alsoBooks=False): for n in list(G.nodes): @@ -895,6 +902,7 @@ def cliInterface(): parser = argparse.ArgumentParser(description='TODO: Write Description.') parser.add_argument('--keep-priv', action="store_true") + parser.add_argument('--keep-whitepaper', action="store_true") parser.add_argument('--remove-read', action="store_true") parser.add_argument('--remove-unread', action="store_true") parser.add_argument('--no-web', action="store_true") @@ -964,6 +972,8 @@ def cliInterface(): removeRead(G) elif args.remove_unread: removeUnread(G) + if not args.keep_whitepapers: + removeWhitepapers(G) removeDangling(G, alsoBooks=True)