Skip to content
Snippets Groups Projects
Commit 1bfdacb0 authored by alexey.stratulat's avatar alexey.stratulat
Browse files

Fix. Import of the dynamic library has worked, though so far only though...

Fix. Import of the dynamic library has worked, though so far only though 'import CellFrame.libCellFrame'
parent bc616e41
No related branches found
No related tags found
1 merge request!9Fix. Import of the dynamic library has worked, though so far only though...
......@@ -114,14 +114,14 @@ static PyMethodDef CellFramePythonMethods[] = {
static struct PyModuleDef CellFramePythonModule = {
PyModuleDef_HEAD_INIT,
"CellFrame", /* name of module */
"libCellFrame", /* name of module */
NULL, /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module,
or -1 if the module keeps state in global variables. */
CellFramePythonMethods
};
PyMODINIT_FUNC PyInit_CellFrame(void);
PyMODINIT_FUNC PyInit_libCellFrame(void);
#ifdef __cplusplus
}
......
......@@ -73,9 +73,12 @@ setup(
author='DEMLABS Inc. (2017-2020)',
license="GNU GPLv3",
packages=['CellFrame'],
ext_modules=[CMakeExtension('CellFrame')],
ext_modules=[CMakeExtension('CellFrame/libCellFrame')],
# add custom build_ext command
cmdclass=dict(build_ext=CMakeBuild),
cmdclass={
'build_ext': CMakeBuild
},
# cmdclass=dict(build_ext=CMakeBuild),
zip_safe=False,
# tests_require=['pytest'],
# setup_requires=setup_requires
......
from .CellFrame import *
#from .libCellFrame import *
......@@ -291,7 +291,7 @@ static PyObject *python_cellframe_init(PyObject *self, PyObject *args){
return PyLong_FromLong(0);
}
PyMODINIT_FUNC PyInit_CellFrame(void){
PyMODINIT_FUNC PyInit_libCellFrame(void){
if (PyType_Ready(&DapObject_DapObjectType) < 0 || PyType_Ready(&dapCrypto_dapCryptoType) < 0 ||
PyType_Ready(&ServerCore_ServerCoreType) < 0 || PyType_Ready(&dapEvents_dapEventsType) < 0 ||
......@@ -459,7 +459,7 @@ int main(int argc, char **argv) {
}
/* Add a built-in module, before Py_Initialize */
PyImport_AppendInittab("CellFrame", PyInit_CellFrame);
PyImport_AppendInittab("libCellFrame", PyInit_libCellFrame);
/* Pass argv[0] to the Python interpreter */
Py_SetProgramName(program);
......@@ -470,7 +470,7 @@ int main(int argc, char **argv) {
/* Optionally import the module; alternatively,
import can be deferred until the embedded script
imports it. */
PyImport_ImportModule("CellFrame");
PyImport_ImportModule("libCellFrame");
PyMem_RawFree(program);
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment