History

python/lib/gen_pyobject.py: prepare for python3 (see #33)

Paul Brossier committed 10 years ago

Commit ade36e61 parent 7ffb5541 file · +6 −6Browse files

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

Unified · Split

python/lib/gen_pyobject.py+6−6
@@ -150,7 +150,7 @@ aubio2pytypes = { · 149 unmodified lines
150aubiovecfrompyobj = {150aubiovecfrompyobj = {
151 'fvec_t*': 'PyAubio_ArrayToCFvec',151 'fvec_t*': 'PyAubio_ArrayToCFvec',
152 'cvec_t*': 'PyAubio_ArrayToCCvec',152 'cvec_t*': 'PyAubio_ArrayToCCvec',
153 'uint_t': '(uint_t)PyInt_AsLong',153 'uint_t': '(uint_t)PyLong_AsLong',
154}154}
155 155
156# aubio to python156# aubio to python
@@ -158,8 +158,8 @@ aubiovectopyobj = { · 1 unmodified line
158 'fvec_t*': 'PyAubio_CFvecToArray',158 'fvec_t*': 'PyAubio_CFvecToArray',
159 'cvec_t*': 'PyAubio_CCvecToPyCvec',159 'cvec_t*': 'PyAubio_CCvecToPyCvec',
160 'smpl_t': 'PyFloat_FromDouble',160 'smpl_t': 'PyFloat_FromDouble',
161 'uint_t*': 'PyInt_FromLong',161 'uint_t*': 'PyLong_FromLong',
162 'uint_t': 'PyInt_FromLong',162 'uint_t': 'PyLong_FromLong',
163}163}
164 164
165def gen_new_init(newfunc, name):165def gen_new_init(newfunc, name):
@@ -171,7 +171,7 @@ def gen_new_init(newfunc, name): · 5 unmodified lines
171 selfparams = '' 171 selfparams = ''
172 # "param1", "param2", "param3"172 # "param1", "param2", "param3"
173 paramnames = ", ".join(["\""+p['name']+"\"" for p in newparams])173 paramnames = ", ".join(["\""+p['name']+"\"" for p in newparams])
174 pyparams = "".join(map(lambda p: aubio2pytypes[p['type']], newparams))174 pyparams = "".join([aubio2pytypes[p['type']] for p in newparams])
175 paramrefs = ", ".join(["&" + p['name'] for p in newparams])175 paramrefs = ", ".join(["&" + p['name'] for p in newparams])
176 s = """\176 s = """\
177// WARNING: this file is generated, DO NOT EDIT177// WARNING: this file is generated, DO NOT EDIT
@@ -288,7 +288,7 @@ def gen_do_input_params(inputparams): · 110 unmodified lines
288 inputdefs += " PyObject * " + p['name'] + "_obj;\n"288 inputdefs += " PyObject * " + p['name'] + "_obj;\n"
289 289
290 inputvecs = " /* input vectors prototypes */\n "290 inputvecs = " /* input vectors prototypes */\n "
291 inputvecs += "\n ".join(map(lambda p: p['type'] + ' ' + p['name'] + ";", inputparams))291 inputvecs += "\n ".join([ p['type'] + ' ' + p['name'] + ";" for p in inputparams])
292 292
293 parseinput = " /* input vectors parsing */\n "293 parseinput = " /* input vectors parsing */\n "
294 for p in inputparams:294 for p in inputparams:
@@ -362,7 +362,7 @@ def gen_do(dofunc, name): · 67 unmodified lines
362 362
363 n_param = len(doparams)363 n_param = len(doparams)
364 364
365 if name in param_numbers.keys():365 if name in list(param_numbers.keys()):
366 n_input_param, n_output_param = param_numbers[name]366 n_input_param, n_output_param = param_numbers[name]
367 else:367 else:
368 n_input_param, n_output_param = 1, n_param - 1368 n_input_param, n_output_param = 1, n_param - 1

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