search for: getargspec

Displaying 3 results from an estimated 3 matches for "getargspec".

2018 Apr 06
1
[nbdkit PATCH] python: Let zero's may_trim parameter be optional
...g_FromString ("inspect"); + if (!pname) + return -1; + inspect = PyImport_Import (pname); + Py_DECREF (pname); + + if (!inspect) + return -1; + +#if PY_MAJOR_VERSION >= 3 + pname = PyString_FromString ("getfullargspec"); +#else + pname = PyString_FromString ("getargspec"); +#endif + spec = PyObject_CallMethodObjArgs (inspect, pname, fn, NULL); + Py_DECREF (pname); + Py_DECREF (inspect); + if (!spec) + return -1; + + /* Yay, we got the signature; now inspect if it contains keyword 'name' */ + args = PyTuple_GetItem(spec, 0); + if (check_list(...
2018 Apr 11
0
[nbdkit PATCH v2 1/5] python: Let zero's may_trim parameter be optional
...ing ("inspect"); +#endif + if (!pname) + return -1; + inspect = PyImport_Import (pname); + Py_DECREF (pname); + + if (!inspect) + return -1; + +#if PY_MAJOR_VERSION >= 3 + pname = PyUnicode_FromString ("getfullargspec"); +#else + pname = PyString_FromString ("getargspec"); +#endif + spec = PyObject_CallMethodObjArgs (inspect, pname, fn, NULL); + Py_DECREF (pname); + Py_DECREF (inspect); + if (!spec) + return -1; + + /* We got the signature; now check for the requested keyword */ + args = PyTuple_GetItem (spec, 0); + if (check_list (args, name)) +...
2018 Apr 11
10
[nbdkit PATCH v2 0/5] FUA support in Python scripts
First out of our four language bindings to add FUA support (for reference, I added 'zero' support for python, perl, and ruby back in 1.1.13, then Rich had to add it for ocaml in 1.1.20). I tested this heavily under python 2, but for now only compile tested under python 3; I plan to do further testing there and make any tweaks if necessary. I wrote patch 5 early on, but then realized I