From 3693327da92cc3d5723e76a6d7a71fa17aca5d69 Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 8 Aug 2017 13:56:10 +0200 Subject: [PATCH] randomdir: nicer filenames --- larigira/audiogen_randomdir.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/larigira/audiogen_randomdir.py b/larigira/audiogen_randomdir.py index fdd99f7..8198119 100644 --- a/larigira/audiogen_randomdir.py +++ b/larigira/audiogen_randomdir.py @@ -39,11 +39,11 @@ def generate(spec): picked = random.sample(found_files, int(spec['howmany'])) - # TODO: use specnick nick = spec.get('nick', spec.eid) for path in picked: tmp = mkstemp(suffix=os.path.splitext(path)[-1], - prefix='randomdir-%s-' % shortname(path)) + prefix='randomdir-%s-%s-' % (shortname(nick), + shortname(path))) os.close(tmp[0]) shutil.copy(path, tmp[1]) log.info("copying %s -> %s", path, os.path.basename(tmp[1]))