diff --git a/caliGraph.py b/caliGraph.py index 2aaf08f..bab3fb1 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -540,6 +540,9 @@ def analyze(G, type_name, name, dist=2.7): ratio = fuzz.ratio(node['label'], name) if ratio > bestRatio: bestRatio, match, n = ratio, node, ni + if not match: + raise Exception("No such "+type_name+" could be found.") + menge = set() pruneDist(G, match, n, dist, menge) for n in list(G.nodes): @@ -601,6 +604,7 @@ def cliInterface(): parser.add_argument('--remove-unread', action="store_true") parser.add_argument('--no-web', 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') p_rec = cmds.add_parser('recommend', description="TODO", aliases=['rec']) @@ -640,6 +644,9 @@ def cliInterface(): else: raise Exception("Bad") + if args.remove_edge: + removeEdge(G) + if not args.no_list: printBestList(G) if not args.no_web: