Renamed some params of the CLI-interface
This commit is contained in:
parent
00c72df281
commit
67737cac48
10
main.py
10
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:
|
||||
|
Loading…
Reference in New Issue
Block a user