added support for pickling the results
authorRichard Penman
Wed, 05 Mar 2014 15:41:49 -0500
changeset 24 16f17c400a70
parent 23 5c3e1a2c9c9a
child 25 f3c0a9a442aa
added support for pickling the results
whois/parser.py
--- a/whois/parser.py	Wed Mar 05 15:27:46 2014 -0500
+++ b/whois/parser.py	Wed Mar 05 15:41:49 2014 -0500
@@ -27,6 +27,7 @@
         '%d-%b-%Y %H:%M:%S %Z',		# 24-Jul-2009 13:20:03 UTC
         '%a %b %d %H:%M:%S %Z %Y',  # Tue Jun 21 23:59:59 GMT 2011
         '%Y-%m-%dT%H:%M:%SZ',       # 2007-01-26T19:10:31Z
+        '%Y-%m-%dT%H:%M:%S%z',      # 2013-12-06T08:17:22-0800
         '%Y-%m-%d %H:%M:%SZ',       # 2000-08-22 18:55:20Z
         '%Y-%m-%d %H:%M:%S',        # 2000-08-22 18:55:20
         '%d %b %Y %H:%M:%S',        # 08 Apr 2013 05:44:00
@@ -96,6 +97,15 @@
         return '\n'.join('%s: %s' % (attr, str(getattr(self, attr))) for attr in self.attrs())
 
 
+    def __getstate__(self):
+        """To support pickling
+        """
+        return self.__dict__
+
+    def __setstate__(self, state):
+        self.__dict__ = state
+
+
     def attrs(self):
         """Return list of attributes that can be extracted for this domain
         """