whois/__init__.py
changeset 31 92176112c2d6
parent 29 1ebe960587b1
child 33 8c4c05eb65f4
equal deleted inserted replaced
30:0ebff1cb6c75 31:92176112c2d6
    43     """
    43     """
    44     if re.match(r'\d+\.\d+\.\d+\.\d+', url):
    44     if re.match(r'\d+\.\d+\.\d+\.\d+', url):
    45         # this is an IP address
    45         # this is an IP address
    46         return socket.gethostbyaddr(url)[0]
    46         return socket.gethostbyaddr(url)[0]
    47 
    47 
    48     tlds_path = os.path.join(os.getcwd(), os.path.dirname(__file__), 'tlds.txt')
    48     tlds_path = os.path.join(os.getcwd(), os.path.dirname(__file__), 'data', 'tlds.txt')
    49     suffixes = [
    49     suffixes = [
    50         line.lower().strip()
    50         line.lower().strip()
    51         for line in open(tlds_path).readlines()
    51         for line in open(tlds_path).readlines()
    52         if not line.startswith('#')
    52         if not line.startswith('#')
    53     ]
    53     ]