added new classes

master
Abhinav Sarkar 2008-07-10 16:55:05 +00:00
parent 2ddd3f320b
commit 0d055183bc
4 changed files with 156 additions and 0 deletions

42
lastfm/group.py Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
__author__ = "Abhinav Sarkar"
__version__ = "0.1"
__license__ = "GNU Lesser General Public License"
class Group(object):
"""A class representing a group on last.fm."""
def __init__(self,
api,
name = None):
self.__api = api
self.__name = name
def getName(self):
return self.__name
name = property(getName, None, None, "Name's Docstring")
def getWeeklyChartList(self):
pass
def getWeeklyAlbumChart(self,
start = None,
end = None):
pass
weeklyAlbumChart = property(getWeeklyAlbumChart, None, None, "Docstring")
def getWeeklyArtistChart(self,
start = None,
end = None):
pass
weeklyArtistChart = property(getWeeklyArtistChart, None, None, "Docstring")
def getWeeklyTrackChart(self,
start = None,
end = None):
pass
weeklyTrackChart = property(getWeeklyTrackChart, None, None, "Docstring")

15
lastfm/playlist.py Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
__author__ = "Abhinav Sarkar"
__version__ = "0.1"
__license__ = "GNU Lesser General Public License"
class Playlist(str):
"""A class representing an XPSF playlist."""
def __init__(self, xpsfData):
self = xpsfData
@staticmethod
def fetch(api, playlistUrl):
params = {'method': 'playlist.fetch'}
return Playlist(api.fetchData(params, parse = False))

41
lastfm/tasteometer.py Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env python
__author__ = "Abhinav Sarkar"
__version__ = "0.1"
__license__ = "GNU Lesser General Public License"
class Tasteometer(object):
"""A class representing a tasteometer."""
def __init__(self,
score = None,
matches = None,
artists = None):
self.__score = score
self.__matches = matches
self.__artists = artists
def getScore(self):
return self.__score
def getMatches(self):
return self.__matches
def getArtists(self):
return self.__artists
score = property(getScore, None, None, "Score's Docstring")
matches = property(getMatches, None, None, "Matches's Docstring")
artists = property(getArtists, None, None, "Artists's Docstring")
@staticmethod
def compare(api,
type1, type2,
value1, value2,
limit = None):
pass
from artist import Artist
from error import LastfmError

58
lastfm/track.py Normal file
View File

@ -0,0 +1,58 @@
#!/usr/bin/env python
__author__ = "Abhinav Sarkar"
__version__ = "0.1"
__license__ = "GNU Lesser General Public License"
class Track(object):
"""A class representing a track."""
def __init__(self,
name = None,
mbid = None,
url = None,
streamable = None,
artist = None,
image = None,
match = None):
self.__name = name
self.__mbid = mbid
self.__url = url
self.__streamable = streamable
self.__artist = artist
self.__image = image
self.__match = match
def getName(self):
return self.__name
def getMbid(self):
return self.__mbid
def getUrl(self):
return self.__url
def getStreamable(self):
return self.__streamable
def getArtist(self):
return self.__artist
def getImage(self):
return self.__image
def getMatch(self):
return self.__match
name = property(getName, None, None, "Name's Docstring")
mbid = property(getMbid, None, None, "Mbid's Docstring")
url = property(getUrl, None, None, "Url's Docstring")
streamable = property(getStreamable, None, None, "Streamable's Docstring")
artist = property(getArtist, None, None, "Artist's Docstring")
image = property(getImage, None, None, "Image's Docstring")
match = property(getMatch, None, None, "Match's Docstring")