discogs: tweak colorization & installation docs

I thought having "MusicBrainz" colored green was a little distracting since
it's the common case (and universal without the discogs plugin), so this just
makes it neutral-color in that case.
This commit is contained in:
Adrian Sampson 2013-05-21 17:59:17 -07:00
parent a26291c4fe
commit 27071a6e38
2 changed files with 10 additions and 12 deletions

View file

@ -132,11 +132,11 @@ def dist_string(dist):
return out
def source_string(source):
colors = {
'MusicBrainz': 'green',
'Unknown': 'red',
}
return ui.colorize(colors.get(source, 'yellow'), source)
"""Colorize a data_source string.
"""
if source == 'MusicBrainz':
return source
return ui.colorize('yellow', source)
def show_change(cur_artist, cur_album, match):
"""Print out a representation of the changes that will be made if an
@ -196,12 +196,10 @@ def show_change(cur_artist, cur_album, match):
print_(message)
# Info line.
info = []
# Distance/similarity.
info.append('(Similarity: %s)' % dist_string(match.distance))
# Source.
info.append('(Source: %s)' % source_string(match.info.data_source))
print_(' '.join(info))
print_('from {0}, similarity: {1}'.format(
source_string(match.info.data_source),
dist_string(match.distance),
))
# Tracks.
pairs = match.mapping.items()

View file

@ -13,4 +13,4 @@ First, enable the ``discogs`` plugin (see :doc:`/plugins/index`).
Then you will need to install the ``discogs-client`` library::
pip install discogs-client>=1.1.1
pip install discogs-client