Commit 70a0a6b7 authored by Julien David's avatar Julien David
Browse files

Merge branch '006--Help-Functions' into 'master'

help funciton

See merge request !8
parents 5c55c648 c0790438
Pipeline #1502 passed with stage
in 17 seconds
......@@ -48,6 +48,14 @@ def query_process(sock: socket, query: dict):
response = db.get_generators()
sock.send(bytes(json.dumps(response), "utf-8"))
print("database generators ", response)
# Sending default generator values
elif ((list(query.keys()))[0] == "default"):
gen = query["default"]
print("generator :", gen)
resp = get_generator_parameters_for_client({gen})
sock.send(bytes(json.dumps(resp), "utf-8"))
# Inserting client query in DATABASE
print("check", check_and_complete_parameters(query))
......@@ -72,6 +80,17 @@ def query_fields(addr, data):
return s
# Function Client Generator gets from database a generator paramaters and default parameters
# Function takes a dict generator to send to database
# Function outputs the result from database
def get_generator_parameters_for_client(generator: dict):
if generator is not None:
res = db.getParameters(generator)
return res
return Exception("Generator Vide !!")
# Function db_send_job send a query to insert in database by socket
# Function takes a socket and dictionary for input
# Function returns a string if query send
Supports Markdown
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