From 67737cac48cda62771128da17a591f0d70671a50 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Wed, 16 Jun 2021 15:18:25 +0200 Subject: [PATCH] Renamed some params of the CLI-interface --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 7deaec3..2ff779d 100644 --- a/main.py +++ b/main.py @@ -315,7 +315,7 @@ def printBestList(G, num=-1): bestlist.append(node) bestlist.sort(key=lambda node: node['score'], reverse=True) for i, book in enumerate(bestlist): - print("["+str(i+1).zfill(int(math.log10(num)+1))+"] "+book['title'] + + print("["+str(i+1).zfill(int((math.log10(num) if num!=-1 else 3)+1))+"] "+book['title'] + " ("+" & ".join(book['authors'])+"): {:.5f}".format(book['score'])) if num!=-1 and i == num-1: break @@ -603,7 +603,7 @@ def cliInterface(): cmds = parser.add_subparsers(required=True, dest='cmd') p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec']) - p_rec.add_argument('-n', type=int, default=25, help='number of books to recommend') + p_rec.add_argument('num', type=int, default=25, help='number of books to recommend') p_read = cmds.add_parser('read', description="TODO", aliases=[]) p_read.add_argument('--min-rating', type=int, default=0) @@ -613,7 +613,7 @@ def cliInterface(): p_show = cmds.add_parser('analyze', description="TODO", aliases=[]) p_show.add_argument('type', choices=['any', 'book', 'recommender', 'author', 'series']) p_show.add_argument('name', type=str) - p_show.add_argument('-d', type=float, default=2.7, help='depth of expansion') + p_show.add_argument('depth', type=float, default=2.7, help='depth of expansion') p_full = cmds.add_parser('full', description="TODO", aliases=[]) @@ -629,11 +629,11 @@ def cliInterface(): removeUnread(G) if args.cmd=="recommend": - recommendNBooks(G, mu, std, args.n) + recommendNBooks(G, mu, std, args.num) elif args.cmd=="read": readBooksAnalysis(G, args.min_rating, args.all_tags, args.only_connected) elif args.cmd=="analyze": - analyze(G, args.type, args.name, args.d) + analyze(G, args.type, args.name, args.depth) elif args.cmd=="full": fullGraph(G) else: