whois/parser.py
changeset 30 0ebff1cb6c75
parent 28 e94a8b50235d
child 37 8ad334b5363b
equal deleted inserted replaced
29:1ebe960587b1 30:0ebff1cb6c75
    90                 values = None
    90                 values = None
    91 
    91 
    92             setattr(self, attr, values)
    92             setattr(self, attr, values)
    93             return getattr(self, attr)
    93             return getattr(self, attr)
    94         else:
    94         else:
    95             raise KeyError('Unknown attribute: %s' % attr)
    95             raise AttributeError('Unknown attribute: %s' % attr)
    96 
    96 
    97     def __str__(self):
    97     def __str__(self):
    98         """Print all whois properties of domain
    98         """Print all whois properties of domain
    99         """
    99         """
   100         return '\n'.join('%s: %s' % (attr, str(getattr(self, attr))) for attr in self.attrs())
   100         return '\n'.join('%s: %s' % (attr, str(getattr(self, attr))) for attr in self.attrs())