Codebase list mirage / aa4cdd7
Update imgfuncs for Python 3 Thomas Ross 3 years ago
2 changed file(s) with 24 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
4141 import md5
4242
4343 try:
44 import imgfuncs
44 import mirage.imgfuncs as imgfuncs
4545
4646 HAS_IMGFUNCS = True
4747 except:
2323 PyObject *ret;
2424
2525 /* Get Python Arguments */
26 if(!PyArg_ParseTuple(args, "z#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
26 if(!PyArg_ParseTuple(args, "y#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
2727 {
2828 return NULL;
2929 }
5050 }
5151 }
5252
53 ret = Py_BuildValue("z#iii", a2, length, w2, h2, rws2);
53 ret = Py_BuildValue("y#iii", a2, length, w2, h2, rws2);
5454 free(a2);
5555
5656 return ret;
7070 PyObject *ret;
7171
7272 /* Get Python Arguments */
73 if(!PyArg_ParseTuple(args, "z#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
73 if(!PyArg_ParseTuple(args, "y#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
7474 {
7575 return NULL;
7676 }
9797 }
9898 }
9999
100 ret = Py_BuildValue("z#iii", a2, length, w2, h2, rws2);
100 ret = Py_BuildValue("y#iii", a2, length, w2, h2, rws2);
101101 free(a2);
102102
103103 return ret;
117117 PyObject *ret;
118118
119119 /* Get Python Arguments */
120 if(!PyArg_ParseTuple(args, "z#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
120 if(!PyArg_ParseTuple(args, "y#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
121121 {
122122 return NULL;
123123 }
140140 }
141141 }
142142
143 ret = Py_BuildValue("z#iii", a2, length, w2, h2, rws2);
143 ret = Py_BuildValue("y#iii", a2, length, w2, h2, rws2);
144144 free(a2);
145145
146146 return ret;
160160 PyObject *ret;
161161
162162 /* Get Python Arguments */
163 if(!PyArg_ParseTuple(args, "z#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
163 if(!PyArg_ParseTuple(args, "y#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
164164 {
165165 return NULL;
166166 }
183183 }
184184 }
185185
186 ret = Py_BuildValue("z#iii", a2, length, w2, h2, rws2);
186 ret = Py_BuildValue("y#iii", a2, length, w2, h2, rws2);
187187 free(a2);
188188
189189 return ret;
203203 PyObject *ret;
204204
205205 /* Get Python Arguments */
206 if(!PyArg_ParseTuple(args, "z#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
206 if(!PyArg_ParseTuple(args, "y#iiii", &a1, &length, &w1, &h1, &rws1, &psz))
207207 {
208208 return NULL;
209209 }
226226 }
227227 }
228228
229 ret = Py_BuildValue("z#iii", a2, length, w2, h2, rws2);
229 ret = Py_BuildValue("y#iii", a2, length, w2, h2, rws2);
230230 free(a2);
231231
232232 return ret;
242242 {NULL, NULL, 0}
243243 };
244244
245 static PyModuleDef imgfuncs_module = {
246 PyModuleDef_HEAD_INIT,
247 "imgfuncs",
248 "Mirage image processing functions",
249 -1,
250 imgfuncs_methods
251 };
252
245253 /* Module initialization function */
246 void initimgfuncs(void)
247 {
248 Py_InitModule("imgfuncs", imgfuncs_methods);
249 }
254 PyMODINIT_FUNC
255 PyInit_imgfuncs(void)
256 {
257 return PyModule_Create(&imgfuncs_module);
258 }