tests/python/localaubio.py: add some tricks to work with waf too
authorPaul Brossier <piem@piem.org>
Fri, 25 Sep 2009 23:04:44 +0000 (01:04 +0200)
committerPaul Brossier <piem@piem.org>
Fri, 25 Sep 2009 23:04:44 +0000 (01:04 +0200)
tests/python/localaubio.py

index 0eaac26937771b34686fcfead6ec466a3f4688be..bf4488a0905cc1b4a427e3890f179f18695357fe 100644 (file)
@@ -8,10 +8,17 @@ except ImportError:
   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: