Beispiel #1
0
def info():
    P = get_info_object()
    query = request.GET.get("arg",'')
    arg = ""
    options = {}
    plugins = []
    if query:
        args, options = util.parse_query(query)
        arg = args[0]
        all_plugins = P.plugins
        relevant_plugins = [p for p in all_plugins if P.compatible_argument(p.name, arg)]
        plugins = sorted(relevant_plugins, key=lambda x:x.name)
        options = json_dumps(options)
        query = cgi.escape(query, quote=True)
    return {"query": query, "arg": arg, "plugins": plugins, "options": options}
Beispiel #2
0
def query_parse_case(input, output):
    assert util.parse_query(input) == output, "%r != %r" % (util.parse_query(input), output)
Beispiel #3
0
def query_parse_case(input, output):
    assert util.parse_query(
        input) == output, "%r != %r" % (util.parse_query(input), output)