Package lastfm :: Module stats

[hide private]
[frames] | no frames]

# Source Code for Module lastfm.stats

     1  #!/usr/bin/env python
     2
     3  __author__ = "Abhinav Sarkar <abhinav@abhinavsarkar.net>"
     4  __version__ = "0.2"
     5  __license__ = "GNU Lesser General Public License"
     6
     7 -class Stats(object):
     8      """A class representing the stats of an artist."""
     9 -    def __init__(self,
    10                   subject,
    11                   listeners = None,
    12                   playcount = None,
    13                   tagcount = None,
    14                   count = None,
    15                   match = None,
    16                   rank = None,
    17                   weight = None,
    18                   attendance = None,
    19                   reviews = None,):
    20          self._subject = subject
    21          self._listeners = listeners
    22          self._playcount = playcount
    23          self._tagcount = tagcount
    24          self._count = count
    25          self._match = match
    26          self._rank = rank
    27          self._weight = weight
    28          self._attendance = attendance
    29          self._reviews = reviews
    30
    31      @property
    32 -    def subject(self):
    33          """subject of the stats"""
    34          return self._subject
    35
    36      @property
    37 -    def rank(self):
    38          """rank of the subject"""
    39          return self._rank
    40
    41      @property
    42 -    def listeners(self):
    43          """number of listeners of the subject"""
    44          return self._listeners
    45
    46      @property
    47 -    def playcount(self):
    48          """playcount of the subject"""
    49          return self._playcount
    50
    51      @property
    52 -    def tagcount(self):
    53          """tagcount of the subject"""
    54          return self._tagcount
    55
    56      @property
    57 -    def count(self):
    58          """count of the subject"""
    59          return self._count
    60
    61      @property
    62 -    def match(self):
    63          """match of the subject"""
    64          return self._match
    65
    66      @property
    67 -    def weight(self):
    68          """weight of the subject"""
    69          return self._weight
    70
    71      @property
    72 -    def attendance(self):
    73          """attendance of the subject"""
    74          return self._attendance
    75
    76      @property
    77 -    def reviews(self):
    78          """reviews of the subject"""
    79          return self._reviews
    80
    81 -    def __repr__(self):
    82          if hasattr(self._subject, 'name'):
    83              return "<lastfm.Stats: for '%s'>" % self._subject.name
    84          else:
    85              return "<lastfm.Stats: for '%s'>" % self._subject
    86