From 1685042792a1e1a7c7f07b486a466efb87594f5a Mon Sep 17 00:00:00 2001 From: Gra Date: Tue, 26 May 2009 17:55:52 +0200 Subject: [PATCH] Added the 'indent' argument for 'format_item'. And added a comment. --- pl.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pl.py b/pl.py index e94e892..82b15b4 100755 --- a/pl.py +++ b/pl.py @@ -218,7 +218,9 @@ def playlist_is_ok(playlist, options): seqmatcher = difflib.SequenceMatcher() # this is the report for missing_item in missing_items: - print " " + format_item(missing_item, options=options), + print format_item(missing_item, + options=options, + indent=2), if options.score < 1: seqmatcher.set_seq1(os.path.basename(missing_item)) for filename in scores: @@ -240,7 +242,9 @@ def playlist_is_ok(playlist, options): else: print "could be" for sugg in suggs[:5]: - print " " + format_item(sugg, options=options) + print format_item(sugg, + options=options, + indent=4) if options.fix: replace = raw_input('Which one to use? [12345, nothing to ignore] ') if replace.strip(): @@ -297,8 +301,9 @@ def replace_in_pl(pl, entry, new): new_pl.append(item) return new_pl -def format_item(item, options): - return item[len(options.target):] +def format_item(item, options, indent=0): + # we remove the target from the path + return ' ' * indent + item[len(options.target):] def print_version(_option, _opt_str, _value, _parser): print "playlist_checker %s" % VERSION -- 2.45.1