basename in index grouper

This commit is contained in:
Michael Murtaugh 2018-05-04 19:10:38 +02:00
parent cdd35867b3
commit 09cd972065

View File

@ -213,23 +213,25 @@ def main (args):
if could_have_base(x, pb): if could_have_base(x, pb):
return p return p
print ("pairing input files with pads", file=sys.stderr)
for x in inputs: for x in inputs:
# pair input with a pad if possible # pair input with a pad if possible
p = get_best_pad(x) xbasename = os.path.basename(x)
p = get_best_pad(xbasename)
if p: if p:
if not has_version(p, x): if not has_version(p, x):
# print ("Grouping file {0} with pad {1}".format(x, p['padid']), file=sys.stderr) print ("Grouping file {0} with pad {1}".format(x, p['padid']), file=sys.stderr)
p['versions'].append(wrappath(x)) p['versions'].append(wrappath(x))
# else: else:
# print ("Skipping existing version {0} ({1})...".format(x, p['padid']), file=sys.stderr) print ("Skipping existing version {0} ({1})...".format(x, p['padid']), file=sys.stderr)
removelist.append(x) removelist.append(x)
# Removed Matches files # Removed Matches files
for x in removelist: for x in removelist:
inputs.remove(x) inputs.remove(x)
# print ("Remaining files:", file=sys.stderr) print ("Remaining files:", file=sys.stderr)
# for x in inputs: for x in inputs:
# print (x, file=sys.stderr) print (x, file=sys.stderr)
# print (file=sys.stderr) print (file=sys.stderr)
# Add "fake" pads for remaining files # Add "fake" pads for remaining files
for x in inputs: for x in inputs:
args.pads.append(metaforpaths([x])) args.pads.append(metaforpaths([x]))