From 7c1726acd6a441a0a46b2624015f0d92d4af8064 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 8 Dec 2013 21:19:12 -0500 Subject: [PATCH] scripts/timeside-launch: create a uuid from the file uri, closes #10 --- scripts/timeside-launch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/timeside-launch b/scripts/timeside-launch index 6fb21ef..2a3935d 100755 --- a/scripts/timeside-launch +++ b/scripts/timeside-launch @@ -190,12 +190,16 @@ if __name__ == '__main__': encoders = map(match_encoder, encoders) def process_file(path): + import uuid + from timeside.decoder.utils import get_uri + file_uuid = str(uuid.uuid5(uuid.NAMESPACE_URL, get_uri(path) )) + decoder = timeside.decoder.FileDecoder(path, start = 1) #pipe.setup(channels = channels, samplerate = samplerate, blocksize = blocksize) pipe = decoder _analyzers = [a() for a in analyzers] _graphers = [g() for g in graphers] - _encoders = [e(os.path.join(outputdir, decoder.uuid() + '.' + e.file_extension())) for e in encoders] + _encoders = [e(os.path.join(outputdir, file_uuid + '.' + e.file_extension())) for e in encoders] for a in _analyzers: pipe = pipe | a @@ -208,13 +212,13 @@ if __name__ == '__main__': if len(_analyzers): results = pipe.results for f in r_formats: - result_path = os.path.join(outputdir, decoder.uuid() + '.' + f) + result_path = os.path.join(outputdir, file_uuid + '.' + f) getattr(results,'to_'+f)(result_path) if verbose : print 'saved', result_path if len(_graphers): for g in _graphers: for f in i_formats: - graph_path = os.path.join(outputdir, decoder.uuid(), g.id() + '.' + f) + graph_path = os.path.join(outputdir, file_uuid, g.id() + '.' + f) if not os.path.isdir(os.path.dirname(graph_path)): os.makedirs(os.path.dirname(graph_path)) g.render(graph_path) -- 2.39.5