Unfix broken fix for #85

This commit is contained in:
hugovk 2014-03-03 12:48:58 +02:00
parent 785139dce6
commit 896e248909

View file

@ -422,33 +422,33 @@ class _Network(object):
def search_for_album(self, album_name): def search_for_album(self, album_name):
"""Searches for an album by its name. Returns a AlbumSearch object. """Searches for an album by its name. Returns a AlbumSearch object.
Use get_next_page() to retreive sequences of results.""" Use get_next_page() to retrieve sequences of results."""
return AlbumSearch(album_name, self) return AlbumSearch(album_name, self)
def search_for_artist(self, artist_name): def search_for_artist(self, artist_name):
"""Searches of an artist by its name. Returns a ArtistSearch object. """Searches of an artist by its name. Returns a ArtistSearch object.
Use get_next_page() to retreive sequences of results.""" Use get_next_page() to retrieve sequences of results."""
return ArtistSearch(artist_name, self) return ArtistSearch(artist_name, self)
def search_for_tag(self, tag_name): def search_for_tag(self, tag_name):
"""Searches of a tag by its name. Returns a TagSearch object. """Searches of a tag by its name. Returns a TagSearch object.
Use get_next_page() to retreive sequences of results.""" Use get_next_page() to retrieve sequences of results."""
return TagSearch(tag_name, self) return TagSearch(tag_name, self)
def search_for_track(self, artist_name, track_name): def search_for_track(self, artist_name, track_name):
"""Searches of a track by its name and its artist. Set artist to an empty string if not available. """Searches of a track by its name and its artist. Set artist to an empty string if not available.
Returns a TrackSearch object. Returns a TrackSearch object.
Use get_next_page() to retreive sequences of results.""" Use get_next_page() to retrieve sequences of results."""
return TrackSearch(artist_name, track_name, self) return TrackSearch(artist_name, track_name, self)
def search_for_venue(self, venue_name, country_name): def search_for_venue(self, venue_name, country_name):
"""Searches of a venue by its name and its country. Set country_name to an empty string if not available. """Searches of a venue by its name and its country. Set country_name to an empty string if not available.
Returns a VenueSearch object. Returns a VenueSearch object.
Use get_next_page() to retreive sequences of results.""" Use get_next_page() to retrieve sequences of results."""
return VenueSearch(venue_name, country_name, self) return VenueSearch(venue_name, country_name, self)
@ -915,7 +915,7 @@ class SessionKeyGenerator(object):
self.web_auth_tokens = {} self.web_auth_tokens = {}
def _get_web_auth_token(self): def _get_web_auth_token(self):
"""Retreives a token from the network for web authentication. """Retrieves a token from the network for web authentication.
The token then has to be authorized from getAuthURL before creating session. The token then has to be authorized from getAuthURL before creating session.
""" """
@ -943,7 +943,7 @@ class SessionKeyGenerator(object):
return url return url
def get_web_auth_session_key(self, url): def get_web_auth_session_key(self, url):
"""Retreives the session key of a web authorization process by its url.""" """Retrieves the session key of a web authorization process by its url."""
if url in self.web_auth_tokens.keys(): if url in self.web_auth_tokens.keys():
token = self.web_auth_tokens[url] token = self.web_auth_tokens[url]
@ -961,7 +961,7 @@ class SessionKeyGenerator(object):
return doc.getElementsByTagName('key')[0].firstChild.data return doc.getElementsByTagName('key')[0].firstChild.data
def get_session_key(self, username, password_hash): def get_session_key(self, username, password_hash):
"""Retreive a session key with a username and a md5 hash of the user's password.""" """Retrieve a session key with a username and a md5 hash of the user's password."""
params = {"username": username, "authToken": md5(username + password_hash)} params = {"username": username, "authToken": md5(username + password_hash)}
request = _Request(self.network, "auth.getMobileSession", params) request = _Request(self.network, "auth.getMobileSession", params)
@ -3486,7 +3486,7 @@ class _Search(_BaseObject):
return _extract(doc, "opensearch:totalResults") return _extract(doc, "opensearch:totalResults")
def _retreive_page(self, page_index): def _retrieve_page(self, page_index):
"""Returns the node of matches to be processed""" """Returns the node of matches to be processed"""
params = self._get_params() params = self._get_params()
@ -3495,9 +3495,9 @@ class _Search(_BaseObject):
return doc.getElementsByTagName(self._ws_prefix + "matches")[0] return doc.getElementsByTagName(self._ws_prefix + "matches")[0]
def _retreive_next_page(self): def _retrieve_next_page(self):
self._last_page_index += 1 self._last_page_index += 1
return self._retreive_page(self._last_page_index) return self._retrieve_page(self._last_page_index)
class AlbumSearch(_Search): class AlbumSearch(_Search):
"""Search for an album by name.""" """Search for an album by name."""
@ -3509,7 +3509,7 @@ class AlbumSearch(_Search):
def get_next_page(self): def get_next_page(self):
"""Returns the next page of results as a sequence of Album objects.""" """Returns the next page of results as a sequence of Album objects."""
master_node = self._retreive_next_page() master_node = self._retrieve_next_page()
seq = [] seq = []
for node in master_node.getElementsByTagName("album"): for node in master_node.getElementsByTagName("album"):
@ -3526,7 +3526,7 @@ class ArtistSearch(_Search):
def get_next_page(self): def get_next_page(self):
"""Returns the next page of results as a sequence of Artist objects.""" """Returns the next page of results as a sequence of Artist objects."""
master_node = self._retreive_next_page() master_node = self._retrieve_next_page()
seq = [] seq = []
for node in master_node.getElementsByTagName("artist"): for node in master_node.getElementsByTagName("artist"):
@ -3546,7 +3546,7 @@ class TagSearch(_Search):
def get_next_page(self): def get_next_page(self):
"""Returns the next page of results as a sequence of Tag objects.""" """Returns the next page of results as a sequence of Tag objects."""
master_node = self._retreive_next_page() master_node = self._retrieve_next_page()
seq = [] seq = []
for node in master_node.getElementsByTagName("tag"): for node in master_node.getElementsByTagName("tag"):
@ -3567,7 +3567,7 @@ class TrackSearch(_Search):
def get_next_page(self): def get_next_page(self):
"""Returns the next page of results as a sequence of Track objects.""" """Returns the next page of results as a sequence of Track objects."""
master_node = self._retreive_next_page() master_node = self._retrieve_next_page()
seq = [] seq = []
for node in master_node.getElementsByTagName("track"): for node in master_node.getElementsByTagName("track"):
@ -3588,7 +3588,7 @@ class VenueSearch(_Search):
def get_next_page(self): def get_next_page(self):
"""Returns the next page of results as a sequence of Track objects.""" """Returns the next page of results as a sequence of Track objects."""
master_node = self._retreive_next_page() master_node = self._retrieve_next_page()
seq = [] seq = []
for node in master_node.getElementsByTagName("venue"): for node in master_node.getElementsByTagName("venue"):