python/tests/utils.py: add array_from_yaml_file
authorPaul Brossier <piem@piem.org>
Wed, 10 Apr 2013 05:28:51 +0000 (00:28 -0500)
committerPaul Brossier <piem@piem.org>
Wed, 10 Apr 2013 05:28:51 +0000 (00:28 -0500)
python/tests/utils.py

index fa4dc44fbd0903751e8d4dfb3c3c0348e9d51a20..fda8cb79258df97cf19931b2bcc78eb4cb9a4812 100644 (file)
@@ -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