Fix typos and style

This commit is contained in:
Mice Pápai 2017-05-05 10:46:31 +02:00
parent 4c820d8565
commit 281bb7c453

View file

@ -709,7 +709,7 @@ class _Network(object):
return Track(_extract(doc, "name", 1), _extract(doc, "name"), self) return Track(_extract(doc, "name", 1), _extract(doc, "name"), self)
def get_artist_by_mbid(self, mbid): 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} params = {"mbid": mbid}
@ -1375,9 +1375,9 @@ Shout = collections.namedtuple(
"Shout", ["body", "author", "date"]) "Shout", ["body", "author", "date"])
def _string_output(funct): def _string_output(func):
def r(*args): def r(*args):
return _string(funct(*args)) return _string(func(*args))
return r return r
@ -1480,20 +1480,20 @@ class _BaseObject(object):
""" """
# Last.fm currently accepts a max of 10 recipient at a time # Last.fm currently accepts a max of 10 recipient at a time
while(len(users) > 10): while len(users) > 10:
section = users[0:9] section = users[0:9]
users = users[9:] users = users[9:]
self.share(section, message) self.share(section, message)
nusers = [] user_names = []
for user in users: for user in users:
if isinstance(user, User): if isinstance(user, User):
nusers.append(user.get_name()) user_names.append(user.get_name())
else: else:
nusers.append(user) user_names.append(user)
params = self._get_params() params = self._get_params()
recipients = ','.join(nusers) recipients = ','.join(user_names)
params['recipient'] = recipients params['recipient'] = recipients
if message: if message:
params['message'] = message params['message'] = message
@ -3006,7 +3006,7 @@ class Tag(_BaseObject, _Chartable):
return seq return seq
def get_top_albums(self, limit=None, cacheable=True): 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() params = self._get_params()
if limit: if limit:
params['limit'] = limit params['limit'] = limit
@ -4331,14 +4331,14 @@ def _unescape_htmlentity(string):
return 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 Extracts a sequence of items from a sequence of TopItem or
LibraryItem objects. LibraryItem objects.
""" """
seq = [] seq = []
for i in topitems_or_libraryitems: for i in top_items_or_library_items:
seq.append(i.item) seq.append(i.item)
return seq return seq