Commit 6431de45 authored by Tomas Hlavacek's avatar Tomas Hlavacek

Generalize decorateASN function

Generalize DecoratorHelper.decorateASN() function to accept formats
AS<number> or simple <number>.
parent e633d86c
......@@ -327,6 +327,7 @@ class DecoratorHelper:
return """<span style="cursor: pointer" onclick="{iframe:'%s',boxid:'frameless',fixed:false,width:750,height:450,closejs:function(){closeJS()}})"><u>%s</u></span>""" % (url,label)
def decorateASN(self,asn,prefix="AS"):
asn = re.sub('[Aa][Ss][Nn]?([0-9]+)','\\1',asn)
return self.mwin(self.getWhoisURL('AS'+str(asn),'AS'),prefix+str(asn))
def decoratePrefix(self,ip):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment