From 295062c8344669d2917ff1227c8d7daee487e8e2 Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 20 Jan 2012 16:49:34 +0100 Subject: [PATCH] Add whois for ipv6 addr, fix missing info for summary, redirect index page to summary --- lg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lg.py b/lg.py index d08ff82..8a31ef1 100755 --- a/lg.py +++ b/lg.py @@ -26,6 +26,7 @@ def add_links(text): else: line = re.sub(r'AS(\d+)', r'AS\1',line) line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'\1',line) + line = re.sub(r'([0-9a-fA-F:]*)', r'\1',line) ret_text.append(line) return "\n".join(ret_text) @@ -52,7 +53,7 @@ def inject_all_host(): @app.route("/") def hello(): - return render_template('index.html') + return redirect("/summary/%s/ipv4" % "+".join(app.config["HOST_MAPPING"].keys()) ) def error_page(text): return render_template('error.html', data = { "error": text } ), 500 @@ -70,7 +71,7 @@ def whois(query): return jsonify(output=output, title=query) SUMMARY_UNWANTED_PROTOS = ["Kernel", "Static", "Device"] -SUMMARY_RE_MATCH = r"(?P[\w_]+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d))(\s+(?P.+)|)" +SUMMARY_RE_MATCH = r"(?P[\w_]+)\s+(?P\w+)\s+(?P
\w+)\s+(?P\w+)\s+(?P((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d))($|\s+(?P.*))" @app.route("/summary/") @app.route("/summary//")