whois/parser.py
changeset 129 ac57dd5a6b20
parent 128 a63883d0a695
child 130 342b440137ce
equal deleted inserted replaced
128:a63883d0a695 129:ac57dd5a6b20
   251             return WhoisSe(domain, text)
   251             return WhoisSe(domain, text)
   252         elif domain.endswith('.is'):
   252         elif domain.endswith('.is'):
   253             return WhoisIs(domain, text)
   253             return WhoisIs(domain, text)
   254         elif domain.endswith('.dk'):
   254         elif domain.endswith('.dk'):
   255             return WhoisDk(domain, text)
   255             return WhoisDk(domain, text)
       
   256         elif domain.endswith('.it'):
       
   257             return WhoisIt(domain, text)
   256         else:
   258         else:
   257             return WhoisEntry(domain, text)
   259             return WhoisEntry(domain, text)
   258 
   260 
   259 
   261 
   260 class WhoisCom(WhoisEntry):
   262 class WhoisCom(WhoisEntry):
  1155         if 'not found.' in text:
  1157         if 'not found.' in text:
  1156             raise PywhoisError(text)
  1158             raise PywhoisError(text)
  1157         else:
  1159         else:
  1158             WhoisEntry.__init__(self, domain, text, self.regex)
  1160             WhoisEntry.__init__(self, domain, text, self.regex)
  1159 
  1161 
       
  1162 class WhoisIt(WhoisEntry):
       
  1163     """Whois parser for .it domains
       
  1164     """
       
  1165     regex = {
       
  1166         'domain_name':                    'Domain: *(.+)',
       
  1167         'creation_date':                  '(?<! )Created: *(.+)',
       
  1168         'updated_date':                   '(?<! )Last Update: *(.+)',
       
  1169         'expiration_date':                '(?<! )Expire Date: *(.+)',
       
  1170         'status':                         'Status: *(.+)',  # list of statuses
       
  1171     }
       
  1172 
       
  1173     def __init__(self, domain, text):
       
  1174         if 'not found.' in text:
       
  1175             raise PywhoisError(text)
       
  1176         else:
       
  1177             WhoisEntry.__init__(self, domain, text, self.regex)
       
  1178 
  1160 
  1179 
  1161 class WhoisIs(WhoisEntry):
  1180 class WhoisIs(WhoisEntry):
  1162     """Whois parser for .se domains
  1181     """Whois parser for .se domains
  1163     """
  1182     """
  1164     regex = {
  1183     regex = {