Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rdos
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien David
rdos
Commits
e92aaf0e
Commit
e92aaf0e
authored
4 years ago
by
Ismail Moumni
Browse files
Options
Downloads
Patches
Plain Diff
adding db_insert
parent
70986542
No related branches found
No related tags found
2 merge requests
!7
WIP : 005 editing server
,
!6
WIP adding get_generator
Pipeline
#723
failed with stage
in 14 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+7
-0
7 additions, 0 deletions
.gitignore
softwares/server/server.py
+14
-1
14 additions, 1 deletion
softwares/server/server.py
with
21 additions
and
1 deletion
.gitignore
+
7
−
0
View file @
e92aaf0e
...
...
@@ -22,3 +22,10 @@ tests/__pycache__/test_query_valid.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_mail.cpython-38-pytest-6.0.2.pyc
softwares/mailer/__init__.py
softwares/server/__init__.py
softwares/database/__pycache__/__init__.cpython-38.pyc
tests/__pycache__/test_missing_json.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_missing_keys.cpython-38-pytest-6.0.2.pyc
softwares/database/__pycache__/database.cpython-38.pyc
tests/__pycache__/test_match_dict.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_match_json.cpython-38-pytest-6.0.2.pyc
tests/__pycache__/test_match_query.cpython-38-pytest-6.0.2.pyc
This diff is collapsed.
Click to expand it.
softwares/server/server.py
+
14
−
1
View file @
e92aaf0e
...
...
@@ -10,7 +10,7 @@ sys.path.append(os.path.realpath('../softwares/'))
__RDOS_Dict__
=
{}
# tools List
__RDOS_Tool__
=
[]
__RDOS_Tool__
=
{}
class
RdosServer
:
...
...
@@ -127,3 +127,16 @@ def db_generators(req: dict):
return
s
else
:
raise
Exception
(
"
Error Database
"
)
# Function db_insert send a query to insert in database by socket
# Function db_insert takes a socket and dictionary for input
# Function db_insert returns a string if query send
def
db_insert
(
s
:
socket
,
req
:
dict
):
if
(
req
is
not
None
):
if
(
verif_param
(
req
)
==
req
):
s
.
send
(
bytes
(
json
.
dumps
(
req
),
"
utf-8
"
)
print
(
"
Query send
"
)
else
:
raise
Exception
(
"
Query Doesn
'
t match
"
)
raise
Exception
(
"
Invalid Query
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment