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