Added remove-egde cli-argument
This commit is contained in:
parent
532357b186
commit
ff5c1ae139
@ -540,6 +540,9 @@ def analyze(G, type_name, name, dist=2.7):
|
|||||||
ratio = fuzz.ratio(node['label'], name)
|
ratio = fuzz.ratio(node['label'], name)
|
||||||
if ratio > bestRatio:
|
if ratio > bestRatio:
|
||||||
bestRatio, match, n = ratio, node, ni
|
bestRatio, match, n = ratio, node, ni
|
||||||
|
if not match:
|
||||||
|
raise Exception("No such "+type_name+" could be found.")
|
||||||
|
|
||||||
menge = set()
|
menge = set()
|
||||||
pruneDist(G, match, n, dist, menge)
|
pruneDist(G, match, n, dist, menge)
|
||||||
for n in list(G.nodes):
|
for n in list(G.nodes):
|
||||||
@ -601,6 +604,7 @@ def cliInterface():
|
|||||||
parser.add_argument('--remove-unread', action="store_true")
|
parser.add_argument('--remove-unread', action="store_true")
|
||||||
parser.add_argument('--no-web', action="store_true")
|
parser.add_argument('--no-web', action="store_true")
|
||||||
parser.add_argument('--no-list', action="store_true")
|
parser.add_argument('--no-list', action="store_true")
|
||||||
|
parser.add_argument('--remove-edge', action="store_true")
|
||||||
cmds = parser.add_subparsers(required=True, dest='cmd')
|
cmds = parser.add_subparsers(required=True, dest='cmd')
|
||||||
|
|
||||||
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec'])
|
||||||
@ -640,6 +644,9 @@ def cliInterface():
|
|||||||
else:
|
else:
|
||||||
raise Exception("Bad")
|
raise Exception("Bad")
|
||||||
|
|
||||||
|
if args.remove_edge:
|
||||||
|
removeEdge(G)
|
||||||
|
|
||||||
if not args.no_list:
|
if not args.no_list:
|
||||||
printBestList(G)
|
printBestList(G)
|
||||||
if not args.no_web:
|
if not args.no_web:
|
||||||
|
Loading…
Reference in New Issue
Block a user