From cfea433649882c105bad26f982b537060eb4bb75 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 29 Oct 2013 01:19:28 +0100 Subject: [PATCH] change decoder id, cleanup --- tests/api/test_all.py | 12 +++++------- timeside/decoder/core.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/api/test_all.py b/tests/api/test_all.py index db33418..b7df0ba 100644 --- a/tests/api/test_all.py +++ b/tests/api/test_all.py @@ -3,14 +3,14 @@ import os, sys import timeside -audio_file = sys.argv[-1] -audio_filename = audio_file.split(os.sep)[-1] +path = sys.argv[-1] +filename = path.split(os.sep)[-1] result_dir = '../results/' if not os.path.exists(result_dir): os.makedirs(result_dir) -decoder = timeside.decoder.FileDecoder(audio_file) +decoder = timeside.decoder.FileDecoder(path) graphers = timeside.core.processors(timeside.api.IGrapher) encoders = timeside.core.processors(timeside.api.IEncoder) analyzers = timeside.core.processors(timeside.api.IAnalyzer) @@ -24,17 +24,15 @@ pipe = decoder for grapher in graphers: proc = grapher() grapher_list.append(proc) - print proc.id() pipe = pipe | proc for analyzer in analyzers: proc = analyzer() analyzer_list.append(proc) - print proc.id() pipe = pipe | proc for encoder in encoders: - path = result_dir + os.sep + audio_filename + '.' + encoder.file_extension() + path = result_dir + os.sep + filename + '.' + encoder.file_extension() proc = encoder(path, overwrite=True) encoder_list.append(proc) pipe = pipe | proc @@ -43,6 +41,6 @@ print pipe pipe.run() for grapher in grapher_list: - image = result_dir + os.sep + audio_filename + '-' + grapher.id() + '.png' + image = result_dir + os.sep + filename + '-' + grapher.id() + '.png' grapher.render(image) diff --git a/timeside/decoder/core.py b/timeside/decoder/core.py index c812dd8..bb7af5e 100644 --- a/timeside/decoder/core.py +++ b/timeside/decoder/core.py @@ -55,7 +55,7 @@ class FileDecoder(Processor): @staticmethod @interfacedoc def id(): - return "gstreamerdec" + return "gst_dec" def __init__(self, uri, start = 0, duration = None): ''' -- 2.39.5