From: Paul Brossier Date: Wed, 10 Apr 2013 05:28:51 +0000 (-0500) Subject: python/tests/utils.py: add array_from_yaml_file X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=269365558f536ae723ef22420137acd718a5c601;p=aubio.git python/tests/utils.py: add array_from_yaml_file --- diff --git a/python/tests/utils.py b/python/tests/utils.py index fa4dc44f..fda8cb79 100644 --- a/python/tests/utils.py +++ b/python/tests/utils.py @@ -11,3 +11,10 @@ def list_all_sounds(rel_dir): import os.path, glob datadir = os.path.join(os.path.dirname(__file__), rel_dir) return glob.glob(os.path.join(datadir,'*.*')) + +def array_from_yaml_file(filename): + import yaml + f = open(filename) + yaml_data = yaml.safe_load(f) + f.close() + return yaml_data