underscore_naming in play (#708)

This commit is contained in:
Adrian Sampson 2014-04-19 14:55:34 -07:00
parent e8f56c897b
commit d96d12440e

View file

@ -51,24 +51,24 @@ def play_music(lib, opts, args):
for album in albums:
paths.append(album.item_dir())
itemType = 'album'
item_type = 'album'
# Preform item query and add tracks to playlist.
else:
paths = [item.path for item in lib.items(ui.decargs(args))]
itemType = 'track'
item_type = 'track'
itemType += 's' if len(paths) > 1 else ''
item_type += 's' if len(paths) > 1 else ''
if not paths:
ui.print_(ui.colorize('yellow', 'No {0} to play.'.format(itemType)))
ui.print_(ui.colorize('yellow', 'No {0} to play.'.format(item_type)))
return
# Warn user before playing any huge playlists.
if len(paths) > 100:
ui.print_(ui.colorize(
'yellow',
'You are about to queue {0} {1}.'.format(len(paths), itemType)))
'You are about to queue {0} {1}.'.format(len(paths), item_type)))
if ui.input_options(('Continue', 'Abort')) == 'a':
return
@ -84,7 +84,7 @@ def play_music(lib, opts, args):
if output:
log.debug(u'Output of {0}: {1}'.format(command, output))
ui.print_(u'Playing {0} {1}.'.format(len(paths), itemType))
ui.print_(u'Playing {0} {1}.'.format(len(paths), item_type))
class PlayPlugin(BeetsPlugin):