mirror of
https://github.com/beetbox/beets.git
synced 2026-02-24 16:23:04 +01:00
Remove unnecessary call to format.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
This commit is contained in:
parent
b0110fa224
commit
c3485b5b04
2 changed files with 11 additions and 3 deletions
|
|
@ -74,13 +74,12 @@ class BareascPlugin(BeetsPlugin):
|
|||
"""Emulate normal 'list' command but with unidecode output."""
|
||||
query = decargs(args)
|
||||
album = opts.album
|
||||
fmt = u''
|
||||
# Copied from commands.py - list_items
|
||||
if album:
|
||||
for album in lib.albums(query):
|
||||
bare = unidecode(six.ensure_text(format(album, fmt)))
|
||||
bare = unidecode(six.ensure_text(str(album)))
|
||||
print_(six.ensure_text(bare))
|
||||
else:
|
||||
for item in lib.items(query):
|
||||
bare = unidecode(six.ensure_text(format(item, fmt)))
|
||||
bare = unidecode(six.ensure_text(str(item)))
|
||||
print_(six.ensure_text(bare))
|
||||
|
|
|
|||
|
|
@ -136,6 +136,15 @@ class BareascPluginTest(unittest.TestCase, TestHelper):
|
|||
|
||||
self.assertIn('Antonin Dvorak', output.getvalue())
|
||||
|
||||
def test_bareasc_format_output(self):
|
||||
"""Bare-ASCII version of list -f command - check output."""
|
||||
with capture_stdout() as output:
|
||||
self.run_command('bareasc', 'with accents',
|
||||
'-f', '$artist:: $title')
|
||||
|
||||
self.assertEqual('Antonin Dvorak:: with accents\n',
|
||||
output.getvalue())
|
||||
|
||||
|
||||
def suite():
|
||||
"""loader."""
|
||||
|
|
|
|||
Loading…
Reference in a new issue