Changeset 911b175d for python/lib
- Timestamp:
- Mar 26, 2017, 1:31:48 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 7928b3b8
- Parents:
- 1136442 (diff), 2a7bcaa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- python/lib
- Files:
-
- 1 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
python/lib/aubio/cut.py
-
Property
mode
changed from
100755
to100644
r1136442 r911b175d 7 7 import sys 8 8 9 usage = "usage: %s [options] -i soundfile" % sys.argv[0]10 usage += "\n help: %s -h" % sys.argv[0]11 12 9 def parse_args(): 13 10 from optparse import OptionParser 11 usage = "usage: %s [options] -i soundfile" % sys.argv[0] 12 usage += "\n help: %s -h" % sys.argv[0] 14 13 parser = OptionParser(usage=usage) 15 14 parser.add_option("-i", "--input", action = "store", dest = "source_file", … … 134 133 (options, args) = parser.parse_args() 135 134 if not options.source_file: 136 import os.path137 135 if len(args) == 1: 138 136 options.source_file = args[0] … … 142 140 return options, args 143 141 144 if __name__ == '__main__':142 def main(): 145 143 options, args = parse_args() 146 144 … … 150 148 source_file = options.source_file 151 149 152 from aubio import onset, tempo, source , sink150 from aubio import onset, tempo, source 153 151 154 152 s = source(source_file, samplerate, hopsize) -
Property
mode
changed from
-
python/lib/moresetuptools.py
r1136442 r911b175d 5 5 from .gen_external import generate_external, header, output_path 6 6 7 def get_aubio_version(): 8 # read from VERSION 9 this_file_dir = os.path.dirname(os.path.abspath(__file__)) 10 version_file = os.path.join(this_file_dir, '..', '..', 'VERSION') 11 12 if not os.path.isfile(version_file): 13 raise SystemError("VERSION file not found.") 14 15 for l in open(version_file).readlines(): 16 #exec (l.strip()) 17 if l.startswith('AUBIO_MAJOR_VERSION'): 18 AUBIO_MAJOR_VERSION = int(l.split('=')[1]) 19 if l.startswith('AUBIO_MINOR_VERSION'): 20 AUBIO_MINOR_VERSION = int(l.split('=')[1]) 21 if l.startswith('AUBIO_PATCH_VERSION'): 22 AUBIO_PATCH_VERSION = int(l.split('=')[1]) 23 if l.startswith('AUBIO_VERSION_STATUS'): 24 AUBIO_VERSION_STATUS = l.split('=')[1].strip()[1:-1] 25 26 if AUBIO_MAJOR_VERSION is None or AUBIO_MINOR_VERSION is None \ 27 or AUBIO_PATCH_VERSION is None: 28 raise SystemError("Failed parsing VERSION file.") 29 30 verstr = '.'.join(map(str, [AUBIO_MAJOR_VERSION, 31 AUBIO_MINOR_VERSION, 32 AUBIO_PATCH_VERSION])) 33 34 if AUBIO_VERSION_STATUS is not None: 35 verstr += AUBIO_VERSION_STATUS 36 return verstr 37 38 def get_aubio_pyversion(): 39 # convert to version for python according to pep 440 40 # see https://www.python.org/dev/peps/pep-0440/ 41 verstr = get_aubio_version() 42 if '~alpha' in verstr: 43 verstr = verstr.split('~')[0] + 'a1' 44 # TODO: add rc, .dev, and .post suffixes, add numbering 45 return verstr 7 from this_version import get_aubio_version 46 8 47 9 # inspired from https://gist.github.com/abergmeier/9488990 … … 94 56 ext.libraries += ['aubio'] 95 57 96 def add_local_aubio_sources(ext , usedouble = False):58 def add_local_aubio_sources(ext): 97 59 """ build aubio inside python module instead of linking against libaubio """ 98 60 print("Info: libaubio was not installed or built locally with waf, adding src/") … … 102 64 103 65 def add_local_macros(ext, usedouble = False): 66 if usedouble: 67 ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] 104 68 # define macros (waf puts them in build/src/config.h) 105 69 for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H', … … 194 158 def build_extension(self, extension): 195 159 if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ: 196 extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]197 160 enable_double = True 198 161 else: … … 205 168 if os.path.isfile(os.path.join('src', 'aubio.h')): 206 169 add_local_aubio_header(extension) 207 add_local_macros(extension )170 add_local_macros(extension, usedouble=enable_double) 208 171 # look for a local waf build 209 172 if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')): … … 213 176 add_external_deps(extension, usedouble=enable_double) 214 177 # add libaubio sources and look for optional deps with pkg-config 215 add_local_aubio_sources(extension , usedouble=enable_double)178 add_local_aubio_sources(extension) 216 179 # generate files python/gen/*.c, python/gen/aubio-generated.h 180 extension.include_dirs += [ output_path ] 217 181 extension.sources += generate_external(header, output_path, overwrite = False, 218 182 usedouble=enable_double)
Note: See TracChangeset
for help on using the changeset viewer.