Improve variable names to match Code Style Guide (see #103)

This commit is contained in:
coderkun 2024-05-28 12:02:43 +02:00
parent 4ebfc12f0e
commit 54fe825acf
6 changed files with 71 additions and 65 deletions

View file

@ -831,12 +831,12 @@ class Client(Base):
self._buffer = buf
def _parse_dict(self, response):
dict = {}
dictionary = {}
if response:
for line in response:
key, value = self._split_line(line)
dict[key] = value
return dict
dictionary[key] = value
return dictionary
def _parse_list(self, response, delimiters):
entry = {}
@ -863,13 +863,13 @@ class Client(Base):
album = None
if 'album' not in song:
song['album'] = MCGAlbum.DEFAULT_ALBUM
id = Utils.generate_id(song['album'])
if lookup and id in self._albums.keys():
album = self._albums[id]
album_id = Utils.generate_id(song['album'])
if lookup and album_id in self._albums.keys():
album = self._albums[album_id]
else:
album = MCGAlbum(song['album'], self._host)
if lookup:
self._albums[id] = album
self._albums[album_id] = album
return album
def _extract_track(self, song):
@ -1047,22 +1047,22 @@ class MCGAlbum:
elif criterion == SortOrder.MODIFIED:
value_function = "get_last_modified"
reverseMultiplier = -1 if reverse else 1
reverse_multiplier = -1 if reverse else 1
value1 = getattr(album1, value_function)()
value2 = getattr(album2, value_function)()
if value1 is None and value2 is None:
return 0
elif value1 is None:
return -1 * reverseMultiplier
return -1 * reverse_multiplier
elif value2 is None:
return 1 * reverseMultiplier
return 1 * reverse_multiplier
if value1 < value2:
return -1 * reverseMultiplier
return -1 * reverse_multiplier
elif value1 == value2:
return 0
else:
return 1 * reverseMultiplier
return 1 * reverse_multiplier
class MCGTrack: