Commit 93c9b3b8 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

modifing server functions

parent acd7f739
Pipeline #1418 failed with stage
in 13 seconds
......@@ -115,7 +115,7 @@ def get_generators():
generators[result[0]] = [result]
def list_gen():
def list_generator():
database = database_connection()
generators = {}
sql_get_generators = "SELECT id, tool from generators"
......
......@@ -59,7 +59,7 @@ def query_process(sock: socket, query: dict):
# Function takes 2 parameters addr : IP address of client and data : Generators values
# Function return a valid insert query
def query_fields(addr, data):
__RDOS_Tool__ = db.list_gen()
__RDOS_Tool__ = db.list_generator()
sa = __RDOS_Tool__.get(list(data.keys())[0])
lm = list((data.values()))
s = {"id": "", "idGenerator": "", "IP": "", "timeSubmitted": "", "timeExecuted": "",
......@@ -145,7 +145,7 @@ def match_query_dict(biblio: dict, data: dict):
# Function check_and_complete_parameters verifies json send from client to server by matching it with database query
# Function input takes a dictionary
# Function output returns query if it matches with database query keys if not it raises an error
def check_and_complete_parameters(data):
def check_and_complete_parameters(data: dict):
if data is not None:
tool = list(data.keys())[0]
s = db.getParameters({tool})
......@@ -162,7 +162,7 @@ def check_and_complete_parameters(data):
else:
raise Exception("Error Database")
else:
raise Exception("Dictionnaire Vide!!")
return Exception("Dictionnaire Vide!!" %s , tool)
# check_and_replace checks query with default_parameters of generator and replaces empty values with default_parameters
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment