Combines the code fragments into source code ready to be compiled
(name, init, body)
| 161 | |
| 162 | |
| 163 | def _make_source(name, init, body): |
| 164 | """ Combines the code fragments into source code ready to be compiled |
| 165 | """ |
| 166 | code = """ |
| 167 | #include <Python.h> |
| 168 | |
| 169 | %(body)s |
| 170 | |
| 171 | PyMODINIT_FUNC |
| 172 | PyInit_%(name)s(void) { |
| 173 | %(init)s |
| 174 | } |
| 175 | """ % dict( |
| 176 | name=name, init=init, body=body, |
| 177 | ) |
| 178 | return code |
| 179 | |
| 180 | |
| 181 | def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], |
no outgoing calls
no test coverage detected