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

Added check of return values ​​and call exceptions. The call to the install...

Added check of return values ​​and call exceptions. The call to the install logging level function from libdap_python_mod is also executed.
parent 4929bde2
No related branches found
No related tags found
No related merge requests found
import json
import libdap_python_module
class DapIniException(Exception):
pass
class Dap:
def __init__(self, data):
res = json.loads(data)
......@@ -8,8 +11,14 @@ class Dap:
self.config_dir=res['dap']['config_dir']
self.log_level=res['dap']['log_level']
self.application_name=res['dap']['application_name']
# dap.init('/opt/var/ler\njaryt\ndebug')
libdap_python_module.init(res['dap']['config_dir']+"\n"+res['dap']['application_name']+"\n")
res_init = libdap_python_module.init(res['dap']['config_dir']+"\n"+res['dap']['application_name']+"\n")
if res_init == -1 or res_init == -2:
raise DapIniException("Initialization erorr")
def __del__(self):
libdap_python_module.deinit()
def setLogLevel(self, data):
self.log_level=data
res_setLogLevel = libdap_python_module.setLogLevel(data)
if res_setLogLevel == -1:
raise DapIniException("Failed to set the logging level, perhaps you did correctly specify the name of the level")
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