whois/parser.py
changeset 87 0f12faf57d33
parent 75 81859268375c
child 88 124331d7ca1e
equal deleted inserted replaced
82:fc40924ac59b 87:0f12faf57d33
   202             return WhoisPt(domain, text)
   202             return WhoisPt(domain, text)
   203         elif domain.endswith('.bg'):
   203         elif domain.endswith('.bg'):
   204             return WhoisBg(domain, text)
   204             return WhoisBg(domain, text)
   205         elif domain.endswith('.de'):
   205         elif domain.endswith('.de'):
   206             return WhoisDe(domain, text)
   206             return WhoisDe(domain, text)
       
   207         elif domain.endswith('.at'):
       
   208             return WhoisAt(domain, text)
   207         elif domain.endswith('.ca'):
   209         elif domain.endswith('.ca'):
   208             return WhoisCa(domain, text)
   210             return WhoisCa(domain, text)
   209         elif domain.endswith('.be'):
   211         elif domain.endswith('.be'):
   210             return WhoisBe(domain, text)
   212             return WhoisBe(domain, text)
   211         elif domain.endswith('.рф'):
   213         elif domain.endswith('.рф'):
   769         if 'Status: free' in text:
   771         if 'Status: free' in text:
   770             raise PywhoisError(text)
   772             raise PywhoisError(text)
   771         else:
   773         else:
   772             WhoisEntry.__init__(self, domain, text, self.regex)
   774             WhoisEntry.__init__(self, domain, text, self.regex)
   773 
   775 
       
   776 class WhoisAt(WhoisEntry):
       
   777     """Whois parser for .at domains
       
   778     """
       
   779     regex = {
       
   780         'name': 'personname: *(.+)',
       
   781         'org': 'organization: *(.+)',
       
   782         'address': 'street address: *(.+)',
       
   783         'zipcode': 'postal code: *(.+)',
       
   784         'city': 'city: *(.+)',
       
   785         'country': 'country: *(.+)',
       
   786         'phone': 'Phone: *(.+)',
       
   787         'fax': 'Fax: *(.+)',
       
   788         'changed': 'changed: *(.+)',
       
   789     }
       
   790 
       
   791     def __init__(self, domain, text):
       
   792         if 'Status: free' in text:
       
   793             raise PywhoisError(text)
       
   794         else:
       
   795             WhoisEntry.__init__(self, domain, text, self.regex)
   774 
   796 
   775 class WhoisBe(WhoisEntry):
   797 class WhoisBe(WhoisEntry):
   776     """Whois parser for .be domains
   798     """Whois parser for .be domains
   777     """
   799     """
   778     regex = {
   800     regex = {