From 281bb7c453b41fa0d9536294995cf9b7f9ccdbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mice=20P=C3=A1pai?= Date: Fri, 5 May 2017 10:46:31 +0200 Subject: [PATCH] Fix typos and style --- pylast/__init__.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pylast/__init__.py b/pylast/__init__.py index 6c9a9a5..0316119 100644 --- a/pylast/__init__.py +++ b/pylast/__init__.py @@ -709,7 +709,7 @@ class _Network(object): return Track(_extract(doc, "name", 1), _extract(doc, "name"), self) def get_artist_by_mbid(self, mbid): - """Loooks up an artist by its MusicBrainz ID""" + """Looks up an artist by its MusicBrainz ID""" params = {"mbid": mbid} @@ -1375,9 +1375,9 @@ Shout = collections.namedtuple( "Shout", ["body", "author", "date"]) -def _string_output(funct): +def _string_output(func): def r(*args): - return _string(funct(*args)) + return _string(func(*args)) return r @@ -1480,20 +1480,20 @@ class _BaseObject(object): """ # Last.fm currently accepts a max of 10 recipient at a time - while(len(users) > 10): + while len(users) > 10: section = users[0:9] users = users[9:] self.share(section, message) - nusers = [] + user_names = [] for user in users: if isinstance(user, User): - nusers.append(user.get_name()) + user_names.append(user.get_name()) else: - nusers.append(user) + user_names.append(user) params = self._get_params() - recipients = ','.join(nusers) + recipients = ','.join(user_names) params['recipient'] = recipients if message: params['message'] = message @@ -3006,7 +3006,7 @@ class Tag(_BaseObject, _Chartable): return seq def get_top_albums(self, limit=None, cacheable=True): - """Retuns a list of the top albums.""" + """Returns a list of the top albums.""" params = self._get_params() if limit: params['limit'] = limit @@ -3100,7 +3100,7 @@ class Track(_Opus): return _extract(doc, "streamable") == "1" def is_fulltrack_available(self): - """Returns True if the fulltrack is available for streaming.""" + """Returns True if the full track is available for streaming.""" doc = self._request(self.ws_prefix + ".getInfo", True) return doc.getElementsByTagName( @@ -4331,14 +4331,14 @@ def _unescape_htmlentity(string): return string -def extract_items(topitems_or_libraryitems): +def extract_items(top_items_or_library_items): """ Extracts a sequence of items from a sequence of TopItem or LibraryItem objects. """ seq = [] - for i in topitems_or_libraryitems: + for i in top_items_or_library_items: seq.append(i.item) return seq