Changeset 5674833


Ignore:
Timestamp:
May 29, 2017, 7:31:18 PM (7 years ago)
Author:
Martin Hermant <martin.hermant@gmail.com>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
Children:
150ec2d
Parents:
15a43e0
Message:

gen_external.py : support parsing of non aubio_ function : fvec and stuffs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    r15a43e0 r5674833  
    130130
    131131    for o in cpp_objects:
    132         if o[:6] != 'aubio_':
    133             continue
    134         shortname = o[6:-2]
     132        shortname = ''
     133        if o[:6] == 'aubio_':
     134            shortname = o[6:-2]  # without aubio_
     135            longname = o[:-2]  # without _t
     136        else: # support object not starting with aubio_ (fvec...)
     137            shortname = o
     138            longname = shortname
     139       
    135140        if shortname in skip_objects:
    136141            continue
     
    138143        lib[shortname]['longname'] = o
    139144        lib[shortname]['shortname'] = shortname
     145        valid_funcname_part = ['_'+longname,longname+'_']
     146
    140147        for fn in cpp_output:
    141             if o[:-1] in fn:
    142                 #print "found", o[:-1], "in", fn
     148            func_name = fn.split('(')[0].strip().split(' ')[1:]
     149            if func_name:
     150                func_name = func_name[-1]
     151            else:
     152                raise NameError('Warning : error while parsing : unexpected line %s' % fn)
     153            if any(x in func_name for x in valid_funcname_part):
     154                # print "found", shortname, "in", fn
    143155                if 'typedef struct ' in fn:
    144156                    lib[shortname]['struct'].append(fn)
Note: See TracChangeset for help on using the changeset viewer.