| 119 | } |
| 120 | |
| 121 | PyObject* PyStreamingAlgorithm::configure (PyStreamingAlgorithm* self, PyObject* args, PyObject* keywds) { |
| 122 | E_DEBUG(EPyBindings, PY_ALGONAME << "::Configure()"); |
| 123 | |
| 124 | // create the list of named parameters that this algorithm can accept |
| 125 | ParameterMap pm = self->algo->defaultParameters(); |
| 126 | |
| 127 | // parse parameters |
| 128 | try { |
| 129 | parseParameters(&pm, args, keywds); |
| 130 | } |
| 131 | catch (const std::exception& e) { |
| 132 | ostringstream msg; |
| 133 | msg << "Error while parsing parameters: " << e.what(); |
| 134 | PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); |
| 135 | return NULL; |
| 136 | } |
| 137 | |
| 138 | // actually configure the underlying C++ algorithm |
| 139 | try { |
| 140 | self->algo->configure(pm); |
| 141 | } |
| 142 | catch (std::exception& e) { |
| 143 | ostringstream msg; |
| 144 | msg << "Error while configuring " << self->algo->name() << ": " << e.what(); |
| 145 | PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); |
| 146 | return NULL; |
| 147 | } |
| 148 | |
| 149 | E_DEBUG(EPyBindings, PY_ALGONAME << "::Configure() done!"); |
| 150 | |
| 151 | Py_RETURN_NONE; |
| 152 | } |
| 153 | |
| 154 | PyObject* PyStreamingAlgorithm::hasSink(PyStreamingAlgorithm* self, PyObject* obj) { |
| 155 | char* name = PyString_AsString(obj); |
nothing calls this directly
no test coverage detected