shithub: aubio

Download patch

ref: a250b357b32e13946b632500c3e85905c54c7297
parent: 7cec7175dccc294d0d2af071c04ec67f76dccbf0
author: Paul Brossier <piem@piem.org>
date: Fri Sep 25 21:04:44 EDT 2009

tests/python/localaubio.py: add some tricks to work with waf too

--- a/tests/python/localaubio.py
+++ b/tests/python/localaubio.py
@@ -8,10 +8,17 @@
   try: 
     import os
     import sys
-    cur_dir = os.path.dirname(sys.argv[0])
+    cur_dir = os.path.dirname(__file__)
     sys.path.append(os.path.join(cur_dir,'..','..','python'))
+    # waf places
     sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
-    from aubio.aubiowrapper import * 
+    sys.path.append(os.path.join(cur_dir,'..','..','build', 'default', 'swig'))
+    # autotools places
+    sys.path.append(os.path.join(cur_dir,'..','..','build', 'default', 'python','aubio'))
+    try:
+      from aubiowrapper import * 
+    except ImportError:
+      from aubio.aubiowrapper import *
   except ImportError:
     raise
 else: