From ceb673dcf1dad4255d74d6fe15f284497aedac6f Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Wed, 25 Jul 2018 05:26:57 -0700 Subject: [PATCH] Remove main() command line, add YAML dumping test --- ovgenpy/ovgenpy.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ovgenpy/ovgenpy.py b/ovgenpy/ovgenpy.py index 2e8cc0f..0591568 100644 --- a/ovgenpy/ovgenpy.py +++ b/ovgenpy/ovgenpy.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- - +import sys import time from pathlib import Path from typing import Optional, List @@ -7,7 +7,7 @@ from typing import Optional, List import click from ovgenpy import outputs -from ovgenpy.config import register_config +from ovgenpy.config import register_config, yaml from ovgenpy.renderer import MatplotlibRenderer, RendererConfig from ovgenpy.triggers import ITriggerConfig, CorrelationTriggerConfig from ovgenpy.wave import WaveConfig, Wave @@ -43,16 +43,11 @@ File = click.Path(exists=True, dir_okay=False) _FPS = 60 # f_s -@click.command() -@click.argument('wave-dir', type=Folder) -@click.option('--audio', '--master-audio', type=File, default=None) -@click.option('--fps', default=_FPS) -@click.option('--output', default='output.mp4') -def main(wave_dir: str, master_audio: Optional[str], fps: int, output: str): +def main(): cfg = Config( - wave_dir=wave_dir, - master_audio=master_audio, - fps=fps, + wave_dir='foo', + master_audio=None, + fps=69, time_visible_ms=25, scan_ratio=1, @@ -77,6 +72,9 @@ def main(wave_dir: str, master_audio: Optional[str], fps: int, output: str): create_window=False ) + yaml.dump(cfg, sys.stdout) + return + ovgen = Ovgen(cfg) ovgen.write()