Skip to content

Commit

Permalink
UI: Apply ANSI styles to import task path string
Browse files Browse the repository at this point in the history
  • Loading branch information
mxmerz committed Nov 1, 2015
1 parent d708022 commit e9caa7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions beets/ui/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,11 @@ def choose_match(self, task):
"""
# Show what we're tagging.
print_()
print_(displayable_path(task.paths, u'\n') +
u' ({0} items)'.format(len(task.items)))
path_str0 = displayable_path(task.paths, u'\n')
path_str = ui.colorize('import_path', path_str0)
items_str0 = u'({0} items)'.format(len(task.items))
items_str = ui.colorize('import_path_items', items_str0)
print_(' '.join([path_str, items_str]))

# Take immediate action if appropriate.
action = _summary_judment(task.rec)
Expand Down

3 comments on commit e9caa7a

@ekjaker
Copy link

@ekjaker ekjaker commented on e9caa7a Nov 4, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I suggest replacing

        path_str0 = displayable_path(task.paths, u'\n')

with

        path_str0 = os.path.basename(normpath(displayable_path(task.paths, u'\n')))

to make the import task path only display the last part of the path?
This is the result:
image

@sampsyo
Copy link
Member

@sampsyo sampsyo commented on e9caa7a Nov 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even better would be to show the path relative to the import base path. (I think this was discussed elsewhere in the UI overhaul thread.)

This should also show multiple paths (when importing a multi-disc album).

@ekjaker
Copy link

@ekjaker ekjaker commented on e9caa7a Nov 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, you're right of course. I figured we could just add a ./if needed, but I didn't take into account the showing of the paths of multidisk albums.

Please sign in to comment.