Changeset 50853b0 for python


Ignore:
Timestamp:
Jul 24, 2017, 4:08:01 PM (7 years ago)
Author:
GitHub <noreply@github.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:
06c329e
Parents:
ccd0327
git-author:
MartinHN <MartinHN@users.noreply.github.com> (07/24/17 16:08:01)
git-committer:
GitHub <noreply@github.com> (07/24/17 16:08:01)
Message:

Update gen_external.py

gen_external :

  • fix unused variable in get_all_func_names_from_lib
  • use proper python syntax : 'is' and 'not in'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    rccd0327 r50853b0  
    119119        if i >= len(cpp_output):
    120120            break
    121         if ('{' in cpp_output[i - 1]) and (not '}' in cpp_output[i - 1]) or (not ';' in cpp_output[i - 1]):
     121        if ('{' in cpp_output[i - 1]) and ('}' not in cpp_output[i - 1]) or (';' not in cpp_output[i - 1]):
    122122            cpp_output[i] = cpp_output[i - 1] + ' ' + cpp_output[i]
    123123            cpp_output.pop(i - 1)
     
    138138
    139139def get_cpp_objects_from_c_declarations(c_declarations, skip_objects=None):
    140     if skip_objects == None:
     140    if skip_objects is None:
    141141        skip_objects = default_skip_objects
    142142    typedefs = filter(lambda y: y.startswith('typedef struct _aubio'), c_declarations)
     
    146146
    147147
    148 def get_all_func_names_from_lib(lib, depth=0):
     148def get_all_func_names_from_lib(lib):
    149149    ''' return flat string of all function used in lib
    150150    '''
    151151    res = []
    152     indent = " " * depth
    153     for k, v in lib.items():
     152    for _, v in lib.items():
    154153        if isinstance(v, dict):
    155             res += get_all_func_names_from_lib(v, depth + 1)
     154            res += get_all_func_names_from_lib(v)
    156155        elif isinstance(v, list):
    157156            for elem in v:
Note: See TracChangeset for help on using the changeset viewer.