From 96e78e6150d2f46fac898f7daad73f1c7899c586 Mon Sep 17 00:00:00 2001 From: John McCardle Date: Mon, 21 Aug 2023 20:27:47 -0400 Subject: [PATCH] Prepwork: marked the spot for adding more types to the Python module --- src/McRFPy_API.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/McRFPy_API.cpp b/src/McRFPy_API.cpp index d5bfcf7..b31d212 100644 --- a/src/McRFPy_API.cpp +++ b/src/McRFPy_API.cpp @@ -107,7 +107,21 @@ static PyModuleDef mcrfpyModule = { // Module initializer fn, passed to PyImport_AppendInittab PyObject* PyInit_mcrfpy() { - return PyModule_Create(&mcrfpyModule); + PyObject* m = PyModule_Create(&mcrfpyModule); + + if (m == NULL) return NULL; + + /* + // add C++ classes exposed to Python here + Py_INCREF(&PyUIMenuType); + if (PyModule_AddObject(m, "Menu", (PyObject *) & PyUIMenuType) < 0) + { + Py_DECREF(&PyUIMenuType); + return NULL; + } + */ + + return m; } // init_python - configure interpreter details here