History

gen_external.py : pass skip_object as member of function to allow custom skip_objects lists

Martin Hermant committed 9 years ago

Commit 51ca6151 parent 6e5c03a1 file · +6 −6Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/gen_external.py+6−6
@@ -11,7 +11,7 @@ source_header = """// this file is generated! do not modify · 10 unmodified lines
1111 #include "aubio-types.h"
1212 """
1313
14−skip_objects = [
14+default_skip_objects = [
1515 # already in ext/
1616 'fft',
1717 'pvoc',
@@ -135,10 +135,13 @@ def get_c_declarations(header=header, usedouble=False): · 117 unmodified lines
135135 return cpp_output
136136
137137
138−def get_cpp_objects_from_c_declarations(c_declarations):
138+def get_cpp_objects_from_c_declarations(c_declarations,skip_objects = None):
139+ if skip_objects==None:
140+ skip_objects = default_skip_objects
139141 typedefs = filter(lambda y: y.startswith('typedef struct _aubio'), c_declarations)
140142 cpp_objects = [a.split()[3][:-1] for a in typedefs]
141− return cpp_objects
143+ cpp_objects_filtered = filter(lambda y: not y[6:-2] in skip_objects, cpp_objects)
144+ return cpp_objects_filtered
142145
143146
144147 def get_all_func_names_from_lib(lib, depth=0):
@@ -178,9 +181,6 @@ def generate_lib_from_c_declarations(cpp_objects, c_declarations): · 33 unmodified lines
178181 if o[:6] == 'aubio_':
179182 shortname = o[6:-2] # without aubio_ prefix and _t suffix
180183
181− if shortname in skip_objects:
182− continue
183−
184184 lib[shortname] = {'struct': [], 'new': [], 'del': [], 'do': [], 'get': [], 'set': [], 'other': []}
185185 lib[shortname]['longname'] = o
186186 lib[shortname]['shortname'] = shortname

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t