| 256 | } |
| 257 | |
| 258 | PyObject* PyStreamingAlgorithm::getOutputType(PyStreamingAlgorithm* self, PyObject* obj) { |
| 259 | char* name = PyString_AsString(obj); |
| 260 | if (name == NULL) { |
| 261 | PyErr_SetString(PyExc_TypeError, "Algorithm.getOutputType requires 1 string argument"); |
| 262 | return NULL; |
| 263 | } |
| 264 | |
| 265 | string outputName = name; |
| 266 | |
| 267 | if (!contains(self->algo->outputs(), outputName)) { |
| 268 | ostringstream msg; |
| 269 | msg << "'" << outputName << "' is not an output of " << self->algo->name() << ". Available outputs are " << self->algo->outputNames(); |
| 270 | PyErr_SetString(PyExc_ValueError, msg.str().c_str()); |
| 271 | return NULL; |
| 272 | } |
| 273 | |
| 274 | string result = edtToString( typeInfoToEdt( self->algo->output(outputName).typeInfo() ) ); |
| 275 | return toPython((void*)&result, STRING); |
| 276 | } |
| 277 | |
| 278 | PyObject* PyStreamingAlgorithm::paramType(PyStreamingAlgorithm* self, PyObject* obj) { |
| 279 | if (!PyString_Check(obj)) { |
no test coverage detected