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
10 -class Shout(LastfmBase, Cacheable):
11 """A class representing a shout."""
12
13 - def init(self,
14 body = None,
15 author = None,
16 date = None):
20
21 @LastfmBase.cached_property
24
25 @LastfmBase.cached_property
28
29 @LastfmBase.cached_property
32
33 @staticmethod
35 try:
36 return hash("%s%s" % (kwds['body'], kwds['author']))
37 except KeyError:
38 raise InvalidParametersError("body and author have to be provided for hashing")
39
42
48
57
59 return "<lastfm.Shout: '%s' by %s>" % (self.body, self.author.name)
60
61 from lastfm.error import InvalidParametersError
62