Commit 847cbd3f authored by Ismail Moumni's avatar Ismail Moumni
Browse files

Adding JSON functions

parent 46658c3b
Pipeline #614 failed with stages
in 6 seconds
......@@ -36,6 +36,10 @@ def server_conn(address, PORT):
serv.close()
# Function query_valid matches the query send from client side
# with the the parameter dict
# Function input dictionnary from client
# Function output boolean true if match else False
def query_valid(data: dict):
if "parameters" in data:
if (data["parameters"] == "request") & (len(data) < 2):
......@@ -43,6 +47,12 @@ def query_valid(data: dict):
return False
# Function send_param_client send a dictionnary containing parameters
# needed to add a query to db
# Function exmaple s = {"ARGUMENTS","Tools":"List of Tools" }
# Function input takes dictionnary and a list of tools
# Function output returns a new dictionnary containing arguments
# # for db query and list of tools
def send_param_client(__RDOS_Dict__: dict, __RDOS_Tools__: list):
dict_cl = {}
if len(__RDOS_Dict__) > 0:
......
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true
}
\ No newline at end of file
#!/usr/bin/env python3
import socket
import os
import sys
import unittest
sys.path.append(os.path.realpath('../softwares/'))
import server as ser
def Test_server():
ser.server_conn()
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