1
2
3 __author__ = "Abhinav Sarkar <abhinav@abhinavsarkar.net>"
4 __version__ = "0.2"
5 __license__ = "GNU Lesser General Public License"
6
7 from lastfm.base import LastfmBase
8 from lastfm.mixins import Cacheable
9 from lastfm.decorators import cached_property
10
11 -class Shout(LastfmBase, Cacheable):
12 """A class representing a shout."""
13
14 - def init(self,
15 body = None,
16 author = None,
17 date = None,
18 **kwargs):
22
23 @cached_property
26
27 @cached_property
30
31 @cached_property
34
35 @staticmethod
37 try:
38 return hash("%s%s" % (kwds['body'], kwds['author']))
39 except KeyError:
40 raise InvalidParametersError("body and author have to be provided for hashing")
41
44
50
59
61 return "<lastfm.Shout: '%s' by %s>" % (self.body, self.author.name)
62
63 from lastfm.error import InvalidParametersError
64