Ignore:
Timestamp:
Aug 29, 2016, 11:21:41 PM (4 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
3f961c4
Parents:
67f0092
Message:

python/lib/gen_external.py: clean-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    r67f0092 r41fc24f  
    120120    return cpp_output, cpp_objects
    121121
    122 def generate_external(header=header, output_path=output_path, usedouble=False, overwrite=True):
    123     if not os.path.isdir(output_path): os.mkdir(output_path)
    124     elif not overwrite: return glob.glob(os.path.join(output_path, '*.c'))
    125     sources_list = []
    126     cpp_output, cpp_objects = get_cpp_objects(header)
     122
     123def analyze_cpp_output(cpp_objects, cpp_output):
    127124    lib = {}
    128125
     
    154151                    #print "no idea what to do about", fn
    155152                    lib[shortname]['other'].append(fn)
    156 
    157     """
     153    return lib
     154
     155def print_cpp_output_results(lib, cpp_output):
    158156    for fn in cpp_output:
    159157        found = 0
     
    163161                    found = 1
    164162        if found == 0:
    165             print "missing", fn
     163            print ("missing", fn)
    166164
    167165    for o in lib:
     
    172170                print ( "{:15s} {:10s} {:s}".format(o, family, lib[o][family][0] ) )
    173171            else:
    174                 print ( "{:15s} {:10s} {:d}".format(o, family, len(lib[o][family]) ) )
    175     """
    176 
     172                print ( "{:15s} {:10s} {:s}".format(o, family, lib[o][family] ) )
     173
     174
     175def generate_external(header=header, output_path=output_path, usedouble=False, overwrite=True):
     176    if not os.path.isdir(output_path): os.mkdir(output_path)
     177    elif not overwrite: return glob.glob(os.path.join(output_path, '*.c'))
     178
     179    cpp_output, cpp_objects = get_cpp_objects(header)
     180
     181    lib = analyze_cpp_output(cpp_objects, cpp_output)
     182    # print_cpp_output_results(lib, cpp_output)
     183
     184    sources_list = []
    177185    try:
    178186        from .gen_code import MappedObject
Note: See TracChangeset for help on using the changeset viewer.