1
0
Fork 0
mirror of https://github.com/sileht/bird-lg.git synced 2024-11-25 16:24:43 +01:00

Add some link

This commit is contained in:
Mehdi Abaakouk 2012-01-26 23:24:15 +01:00
parent cd4b763523
commit 7991945f5f

2
lg.py
View file

@ -38,7 +38,7 @@ def add_links(text):
line = re.sub(r'AS(\d+)', r'<a href="/whois/\1" class="whois">AS\1</a>',line) line = re.sub(r'AS(\d+)', r'<a href="/whois/\1" class="whois">AS\1</a>',line)
line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'<a href="/whois/\1" class="whois">\1</a>',line) line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'<a href="/whois/\1" class="whois">\1</a>',line)
hosts = "/".join(request.path.split("/")[2:]) hosts = "/".join(request.path.split("/")[2:])
line = re.sub(r'\[(\w+)\s+((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d)\]', r'[<a href="/detail/%s?q=\1">\1</a> \2]' % hosts, line) line = re.sub(r'\[(\w+)\s+((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d)', r'[<a href="/detail/%s?q=\1">\1</a> \2' % hosts, line)
ret_text.append(line) ret_text.append(line)
return "\n".join(ret_text) return "\n".join(ret_text)