source: tests/python/localaubio.py @ 1cc007c

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 1cc007c was a250b35, checked in by Paul Brossier <piem@piem.org>, 15 years ago

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

  • Property mode set to 100644
File size: 978 bytes
Line 
1
2# add ${src}/python and ${src}/python/aubio/.libs to python path
3# so the script is runnable from a compiled source tree.
4
5try:
6  from aubio.aubiowrapper import * 
7except ImportError:
8  try: 
9    import os
10    import sys
11    cur_dir = os.path.dirname(__file__)
12    sys.path.append(os.path.join(cur_dir,'..','..','python'))
13    # waf places
14    sys.path.append(os.path.join(cur_dir,'..','..','python','aubio','.libs'))
15    sys.path.append(os.path.join(cur_dir,'..','..','build', 'default', 'swig'))
16    # autotools places
17    sys.path.append(os.path.join(cur_dir,'..','..','build', 'default', 'python','aubio'))
18    try:
19      from aubiowrapper import * 
20    except ImportError:
21      from aubio.aubiowrapper import *
22  except ImportError:
23    raise
24else:
25  raise ImportError, \
26    """
27    The aubio module could be imported BEFORE adding the source directory to
28    your path. Make sure you NO other version of the python aubio module is
29    installed on your system.
30    """
Note: See TracBrowser for help on using the repository browser.