Starting module interface impl

parent 5ab1d07a
...@@ -96,7 +96,21 @@ static PyObject* va_reset(PyObject*, PyObject*) ...@@ -96,7 +96,21 @@ static PyObject* va_reset(PyObject*, PyObject*)
static PyObject* va_enumerate_modules(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames) static PyObject* va_enumerate_modules(PyObject* pSelf, PyObject** ppArgs, Py_ssize_t nArgs, PyObject* pKeywordNames)
{ {
VAPY_REQUIRE_CONN_TRY; VAPY_REQUIRE_CONN_TRY;
VA_EXCEPT_NOT_IMPLEMENTED;
std::vector< CVAModuleInfo > voModuleInfos;
g_pVANetClient->GetCoreInstance()->EnumerateModules(voModuleInfos);
PyObject *pModuleList = PyList_New(voModuleInfos.size());
for (size_t i = 0; i < voModuleInfos.size(); i++)
{
CVAModuleInfo& oModule(voModuleInfos[i]);
PyObject* pModuleInfo = Py_BuildValue("{s:i,s:s,s:s}", "index", i, "name", oModule.sName, "description", oModule.sDesc);
PyList_SetItem(pModuleList, i, pModuleInfo); // steals reference
}
return pModuleList;
VAPY_CATCH_RETURN; VAPY_CATCH_RETURN;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment