Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KWH40
fml40-reference-implementation
Commits
0bf6d138
Commit
0bf6d138
authored
Nov 24, 2020
by
Jiahang Chen
Browse files
ADD: judgement statement to callback function
parent
ac34cd82
Pipeline
#365899
passed with stages
in 1 minute and 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ml/thing.py
View file @
0bf6d138
...
...
@@ -307,13 +307,19 @@ def on_get_value_request(self, msg):
receiver_endpoints
=
[
request_sender_endpoint
],
msg
=
json
.
dumps
(
get_value_reply
.
msg
),
)
if
res
.
status_code
==
201
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
": Send a S³I-B GetValueReply back to the requester."
)
if
self
.
__is_broker_rest
:
if
res
.
status_code
==
201
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
": Send a S³I-B GetValueReply back to the requester "
)
else
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
res
.
text
)
def
_uriToData
(
self
,
uri
):
if
uri
==
""
:
...
...
@@ -439,13 +445,19 @@ def on_service_request(self, body_json):
res
=
self
.
broker
.
send
(
receiver_endpoints
=
[
body_json
.
get
(
"replyToEndpoint"
,
None
)],
msg
=
json
.
dumps
(
service_reply
.
msg
))
if
res
.
status_code
==
201
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
": Send a S³I-B ServiceReply back to the requester "
)
if
self
.
__is_broker_rest
:
if
res
.
status_code
==
201
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
": Send a S³I-B ServiceReply back to the requester "
)
else
:
print
(
BColors
.
OKBLUE
+
"[S³I][Broker]"
+
BColors
.
ENDC
+
res
.
text
)
def
on_get_value_reply
(
self
,
msg
):
print
(
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment