From b00a0b5116a8e3d5d701d913f1c858a1aff976e4 Mon Sep 17 00:00:00 2001 From: Aleksandr Vodianov <aleksandr.vodianov@demlabs.net> Date: Fri, 4 Feb 2022 16:16:30 +0000 Subject: [PATCH] Hotfix 5526 --- .gitignore | 32 ++++++++++++------------- modules/plugins/src/dap_chain_plugins.c | 4 ++++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index dbe4e7a6..854ee381 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,16 @@ -build/* -example/tmp -example/var -*.text -_skbuild/ -.pybuild/ -dist/ -CellFrame.egg-info/ -debian/*.log -debian/*.debhelper -debian/*.substvars -debian/python3-cellframe-doc/ -debian/python3-cellframe/ -debian/files -*.text -CMakeLists.txt.user* +# Импортируем модуль os +import os +# Импортируем модуль sys +import sys +while True: +# Принимаем Ð¸Ð¼Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ Ñреды +key_value = input(«Enter the key of the environment variable:») +# ПроверÑем, инициализирована ли Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ +try: +if os.environ[key_value]: +print(«The value of», key_value, » is «, os.environ[key_value]) +# ЕÑли переменной не приÑвоено значение, то ошибка +except KeyError: +print(key_value, ‘environment variable is not set.’) +# Завершаем процеÑÑ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ñкрипта +sys.exit(1) \ No newline at end of file diff --git a/modules/plugins/src/dap_chain_plugins.c b/modules/plugins/src/dap_chain_plugins.c index c3d5a32b..60bfaa12 100644 --- a/modules/plugins/src/dap_chain_plugins.c +++ b/modules/plugins/src/dap_chain_plugins.c @@ -27,6 +27,10 @@ int dap_chain_plugins_init(dap_config_t *a_config){ return -1; } PyImport_AppendInittab("API_CellFrame", PyInit_libCellFrame); + #ifdef DAP_BUILD_WITH_PYTHON_ENV + const wchar_t *l_python_env_path = L"/opt/cellframe-node/lib/python3.7"; + Py_SetPath(l_python_env_path); + #endif Py_Initialize(); PyEval_InitThreads(); PyObject *l_sys_module = PyImport_ImportModule("sys"); -- GitLab