Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Julien David
rdos
Commits
861ad65b
Commit
861ad65b
authored
Oct 16, 2020
by
Ismail Moumni
Browse files
help funciton
parent
5972adc7
Pipeline
#1495
failed with stage
in 15 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
softwares/server/server.py
View file @
861ad65b
...
...
@@ -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
=
client_generator
({
gen
})
sock
.
send
(
bytes
(
json
.
dumps
(
resp
),
"utf-8"
))
# Inserting client query in DATABASE
else
:
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
client_generator
(
generator
:
dict
):
if
generator
is
not
None
:
res
=
db
.
getParameters
(
generator
)
return
res
else
:
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment