# HG changeset patch # User Richard Penman # Date 1394052109 18000 # Node ID 16f17c400a70bc18a8f2fd4b47d128825fe8a5cb # Parent 5c3e1a2c9c9a2fbd3bdf4869982722e2a2ab67c1 added support for pickling the results diff -r 5c3e1a2c9c9a -r 16f17c400a70 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 """