whois/parser.py
changeset 157 f091b6581d21
parent 155 08133c057eed
parent 156 9437303d43e8
child 159 3b39f61b8a81
child 161 54de7f516385
--- a/whois/parser.py	Thu Dec 14 23:48:29 2017 +0100
+++ b/whois/parser.py	Wed Dec 20 18:15:24 2017 +0000
@@ -269,6 +269,8 @@
             return WhoisIn(domain, text)
         elif domain.endswith('.cat'):
             return WhoisCat(domain, text)
+        elif domain.endswith('.ie'):
+            return WhoisIe(domain, text)
         else:
             return WhoisEntry(domain, text)
 
@@ -1333,3 +1335,25 @@
             self._regex.copy().update(self.regex)
             self.regex = self._regex
             WhoisEntry.__init__(self, domain, text, self.regex)
+
+
+class WhoisIe(WhoisEntry):
+    """Whois parser for .ie domains
+    """
+    regex = {
+        'domain_name':      'domain: *(.+)',
+        'description':      'descr: *(.+)',
+        'source':           'Source: *(.+)',
+        'creation_date':    'registration: *(.+)',
+        'expiration_date':  'renewal: *(.+)',
+        'name_servers':     'nserver: *(.+)',
+        'status':           'ren-status: *(.+)',
+        'admin_id':         'admin-c: *(.+)',
+        'tech_id':          'tech-c: *(.+)'
+    }
+
+    def __init__(self, domain, text):
+        if 'no matching objects' in text:
+            raise PywhoisError(text)
+        else:
+            WhoisEntry.__init__(self, domain, text, self.regex)