| 93 | |
| 94 | |
| 95 | int PyAlgorithm::init(PyAlgorithm *self, PyObject *args, PyObject *kwds) { |
| 96 | static char *kwlist[] = { (char*)"name", NULL }; |
| 97 | char* algoname; |
| 98 | |
| 99 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &algoname)) { |
| 100 | return -1; |
| 101 | } |
| 102 | |
| 103 | E_DEBUG(EPyBindings, "Standard : " << algoname << "::init()"); |
| 104 | |
| 105 | try { |
| 106 | E_DEBUG(EPyBindings, "Standard : creating with name " << algoname); |
| 107 | self->algo = AlgorithmFactory::create(algoname); |
| 108 | } |
| 109 | catch (exception& e) { |
| 110 | PyErr_SetString(PyExc_ValueError, e.what()); |
| 111 | return -1; |
| 112 | } |
| 113 | |
| 114 | E_DEBUG(EPyBindings, PY_ALGONAME << "::init() done!"); |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | |
| 119 | |