mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 12:35:19 +01:00
Merge pull request #4129 from tianon/color-move
Use "colordiff" to highlight "beet move" path differences
This commit is contained in:
commit
bcdf78e0c3
2 changed files with 10 additions and 3 deletions
|
|
@ -757,15 +757,21 @@ def show_path_changes(path_changes):
|
|||
if max_width > col_width:
|
||||
# Print every change over two lines
|
||||
for source, dest in zip(sources, destinations):
|
||||
log.info('{0} \n -> {1}', source, dest)
|
||||
color_source, color_dest = colordiff(source, dest)
|
||||
print_('{0} \n -> {1}'.format(color_source, color_dest))
|
||||
else:
|
||||
# Print every change on a single line, and add a header
|
||||
title_pad = max_width - len('Source ') + len(' -> ')
|
||||
|
||||
log.info('Source {0} Destination', ' ' * title_pad)
|
||||
print_('Source {0} Destination'.format(' ' * title_pad))
|
||||
for source, dest in zip(sources, destinations):
|
||||
pad = max_width - len(source)
|
||||
log.info('{0} {1} -> {2}', source, ' ' * pad, dest)
|
||||
color_source, color_dest = colordiff(source, dest)
|
||||
print_('{0} {1} -> {2}'.format(
|
||||
color_source,
|
||||
' ' * pad,
|
||||
color_dest,
|
||||
))
|
||||
|
||||
|
||||
# Helper functions for option parsing.
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ Other new things:
|
|||
subdirectories in library.
|
||||
* :doc:`/plugins/info`: Support ``--album`` flag.
|
||||
* :doc:`/plugins/export`: Support ``--album`` flag.
|
||||
* ``beet move`` path differences are now highlighted in color (when enabled).
|
||||
|
||||
For plugin developers:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue