]> git.parisson.com Git - timeside.git/commitdiff
scripts/timeside-launch: create a uuid from the file uri, closes #10
authorPaul Brossier <piem@piem.org>
Mon, 9 Dec 2013 02:19:12 +0000 (21:19 -0500)
committerPaul Brossier <piem@piem.org>
Mon, 9 Dec 2013 02:19:12 +0000 (21:19 -0500)
scripts/timeside-launch

index 6fb21efd1d9808c81b7893a999ac0ea75e722cd4..2a3935d00efcad59e592e026aa74ee0f62f1a9dd 100755 (executable)
@@ -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)