From e092099bde76c44fc763937ffed3602f4d91e355 Mon Sep 17 00:00:00 2001 From: Amr Hassan Date: Mon, 31 Aug 2009 04:57:13 +0000 Subject: [PATCH] --- .build | 2 +- pylast.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.build b/.build index 56a6051..d8263ee 100644 --- a/.build +++ b/.build @@ -1 +1 @@ -1 \ No newline at end of file +2 \ No newline at end of file diff --git a/pylast.py b/pylast.py index a244f3c..31afb1a 100644 --- a/pylast.py +++ b/pylast.py @@ -292,6 +292,55 @@ class Network(object): self.proxy = None self.last_call_time = 0 + def get_artist(self, artist_name): + """ + Return an Artist object + """ + + return Artist(artist_name, self) + + def get_track(self, artist, title): + """ + Return a Track object + """ + + return Track(artist, title, self) + + def get_album(self, artist, title): + """ + Return an Album object + """ + + return Album(artist, title, self) + + def get_authenticated_user(self): + """ + Returns the authenticated user + """ + + return AuthenticatedUser(self) + + def get_country(self, country_name): + """ + Returns a country object + """ + + return Country(country_name, self) + + def get_user(self, username): + """ + Returns a user object + """ + + return User(username, self) + + def get_tag(self, name): + """ + Returns a tag object + """ + + return Tag(name, self) + def get_scrobbler(self, client_id, client_version): """ Returns a Scrobbler object used for submitting tracks to the server @@ -386,7 +435,7 @@ class Network(object): doc = self._Request(self, "tag.getTopTags").execute(True) list = [] for node in doc.getElementsByTagName("tag"): - tag = Tag(_extract(node, "name"), network) + tag = Tag(_extract(node, "name"), self) weight = _extract(node, "count") list.append(TopItem(tag, weight))