1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| static PyMethodDef PCCMethods[] = { {"Init", Init, METH_VARARGS, "初始化"}, {"UnInit", UnInit, METH_VARARGS, "卸载"}, {"SetServeIPP", SetServeIPP, METH_VARARGS, "建立连接"}, {"SetJobCallback", SetJobCallback, METH_VARARGS, "设置回调函数"}, {"ListTrunk", ListTrunk, METH_VARARGS, "列举trunk"}, {"ListModules", ListModules, METH_VARARGS, "列举模块"}, {"ListModels", ListModels, METH_VARARGS, "列举模型"}, {"Execute", Execute, METH_VARARGS, "提交作业"}, {"QueryJobs", QueryJobs, METH_VARARGS, "查询作业"}, {"QueryJobsOnDoing", QueryJobsOnDoing, METH_VARARGS, "查询作业"}, {"QueryJobsByID", QueryJobsByID, METH_VARARGS, "查询作业"}, {"CancelJobs", CancelJobs, METH_VARARGS, "取消作业"}, {"testCallback", testCallback, METH_VARARGS, "提交作业"}, {"testcase1", testcase1, METH_VARARGS, "测试用例"}, {"testcase2", testcase2, METH_VARARGS, "测试用例"}, {NULL, NULL, 0, NULL} };
extern "C" PyMODINIT_FUNC initPCCUserppyy(void) { PyObject *m;
PyEval_InitThreads() ; m = Py_InitModule("PCCUserppyy", PCCMethods); if (m == NULL) return;
PCCError = PyErr_NewException("PCC.error", NULL, NULL); Py_INCREF(PCCError); PyModule_AddObject(m, "error", PCCError); }
|