Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cellframe/python-cellframe
1 result
Show changes
Commits on Source (2)
...@@ -8,25 +8,31 @@ void dap_chain_node_client_deinit_py(void){ ...@@ -8,25 +8,31 @@ void dap_chain_node_client_deinit_py(void){
} }
PyObject *dap_chain_client_connect_py(PyObject *self, PyObject *args){ PyObject *dap_chain_client_connect_py(PyObject *self, PyObject *args){
PyObject *obj_net;
PyObject *obj_node_info; PyObject *obj_node_info;
const char *active_channels; const char *active_channels;
if (!PyArg_ParseTuple(args, "O|s", &obj_node_info, &active_channels)) if (!PyArg_ParseTuple(args, "O|O|s",&obj_net, &obj_node_info, &active_channels))
return NULL; return NULL;
PyObject *obj_node_client = _PyObject_New(&DapChainNodeClientObject_DapChainNodeClientObjectType); PyObject *obj_node_client = _PyObject_New(&DapChainNodeClientObject_DapChainNodeClientObjectType);
((PyDapChainNodeClientObject*)obj_node_client)->node_client =dap_chain_client_connect( ((PyDapChainNodeClientObject*)obj_node_client)->node_client =dap_chain_node_client_connect_channels(
((PyDapChainNetObject*) obj_net)->chain_net,
((PyDapChainNodeInfoObject*)obj_node_info)->node_info, active_channels); ((PyDapChainNodeInfoObject*)obj_node_info)->node_info, active_channels);
return Py_BuildValue("O", obj_node_client); return Py_BuildValue("O", obj_node_client);
} }
PyObject *dap_chain_node_client_connect_py(PyObject *self, PyObject *args){ PyObject *dap_chain_node_client_connect_py(PyObject *self, PyObject *args){
if (self != NULL){ if (self != NULL){
PyErr_SetString(PyExc_SyntaxWarning, "This is method called statically"); PyErr_SetString(PyExc_SyntaxWarning, "This is method called statically");
return NULL; return NULL;
} }
PyObject *obj_net;
PyObject *obj_node_info; PyObject *obj_node_info;
if (!PyArg_ParseTuple(args, "O", &obj_node_info)) if (!PyArg_ParseTuple(args, "O|O",&obj_net, &obj_node_info))
return NULL; return NULL;
PyObject *obj_node_client = _PyObject_New(&DapChainNodeClientObject_DapChainNodeClientObjectType); PyObject *obj_node_client = _PyObject_New(&DapChainNodeClientObject_DapChainNodeClientObjectType);
((PyDapChainNodeClientObject*)obj_node_client)->node_client = dap_chain_node_client_connect(((PyDapChainNodeInfoObject*)obj_node_info)->node_info); ((PyDapChainNodeClientObject*)obj_node_client)->node_client = dap_chain_node_client_connect(
((PyDapChainNetObject*) obj_net)->chain_net,
((PyDapChainNodeInfoObject*)obj_node_info)->node_info);
return Py_BuildValue("O", obj_node_client); return Py_BuildValue("O", obj_node_client);
} }
PyObject *dap_chain_node_client_close_py(PyObject *self, PyObject *args){ PyObject *dap_chain_node_client_close_py(PyObject *self, PyObject *args){
......
...@@ -51,8 +51,7 @@ int dap_chain_plugins_init(dap_config_t *a_config){ ...@@ -51,8 +51,7 @@ int dap_chain_plugins_init(dap_config_t *a_config){
dap_chain_plugins_command_create(); dap_chain_plugins_command_create();
PyThreadState *l_thread_state = PyEval_SaveThread(); PyThreadState *l_thread_state = PyEval_SaveThread();
}else{ }else{
log_it(L_NOTICE, "Permission to initialize python plugins has not been obtained."); return 0;
return -2;
} }
return 0; return 0;
} }
......