comparison query.py @ 10:1af09c5ec0a1 draft

Uploaded 20180413
author fabio
date Fri, 13 Apr 2018 07:51:29 -0400
parents 300e4932bad6
children 19ac771cf32a
comparison
equal deleted inserted replaced
9:c144495810c2 10:1af09c5ec0a1
33 # add additional parameters to the payload 33 # add additional parameters to the payload
34 #payload["tree_id"] = str(options.treeid); 34 #payload["tree_id"] = str(options.treeid);
35 payload["search_mode"] = str(options.search); 35 payload["search_mode"] = str(options.search);
36 payload["exact_algorithm"] = int(options.exact); 36 payload["exact_algorithm"] = int(options.exact);
37 payload["search_threshold"] = float(options.sthreshold); 37 payload["search_threshold"] = float(options.sthreshold);
38 payload["sort"] = int(options.sortcontrol);
38 # set the content type to application/json 39 # set the content type to application/json
39 headers = {'Content-type': 'application/json'}; 40 headers = {'Content-type': 'application/json'};
40 41
41 # create a session 42 # create a session
42 session = requests.Session(); 43 session = requests.Session();
185 action="store", dest="exact", help="exact algorithm (required if search is 1 only)"); 186 action="store", dest="exact", help="exact algorithm (required if search is 1 only)");
186 parser.add_option("-k", "--tree", type="int", default=0, 187 parser.add_option("-k", "--tree", type="int", default=0,
187 action="store", dest="treeid", help="the id of the tree that will be queried"); 188 action="store", dest="treeid", help="the id of the tree that will be queried");
188 parser.add_option("-t", "--sthreshold", type="float", 189 parser.add_option("-t", "--sthreshold", type="float",
189 action="store", dest="sthreshold", help="threshold applied to the search algrithm"); 190 action="store", dest="sthreshold", help="threshold applied to the search algrithm");
191 parser.add_option("-z", "--sort", type="int", default=1,
192 action="store", dest="sortcontrol", help="boolean required to sort the result");
190 parser.add_option("-o", "--outputdir", type="string", default="output", 193 parser.add_option("-o", "--outputdir", type="string", default="output",
191 action="store", dest="outputdir", help="output directory (collection) path"); 194 action="store", dest="outputdir", help="output directory (collection) path");
192 parser.add_option("-r", "--errorfile", type="string", default="error_txt", 195 parser.add_option("-r", "--errorfile", type="string", default="error_txt",
193 action="store", dest="errorfile", help="error file name containing error messages"); 196 action="store", dest="errorfile", help="error file name containing error messages");
194 197