Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -234,8 +234,10 @@ with gr.Blocks() as app:
|
|
234 |
send_mes_btn=gr.Button()
|
235 |
with gr.Column():
|
236 |
block_text = gr.Textbox(label = "System", interactive = False)
|
|
|
237 |
response_json=gr.JSON()
|
238 |
-
|
|
|
239 |
|
240 |
|
241 |
|
@@ -292,23 +294,14 @@ with gr.Blocks() as app:
|
|
292 |
|
293 |
dec = crypt.decrypt_trans(ea,im)
|
294 |
print(f'dec === {dec}')
|
295 |
-
|
296 |
-
#dec=dec.strip('{}')
|
297 |
-
#string = dec.strip('{}')
|
298 |
-
# split the string into key-value pairs
|
299 |
-
# pairs = string.split(', ')
|
300 |
-
# print(f'PAIRS ::: {pairs}')
|
301 |
-
# json_dec = {key1[1:-2]: str(value) for key1, value in (pair.split(': ') for pair in pairs)}
|
302 |
-
#print(f'KEY ::: {key}')
|
303 |
-
#print(f'VALUE ::: {value}')
|
304 |
-
#dec={dec}
|
305 |
dec=eval(dec)
|
306 |
#json_dec=json.loads(f"{dec}")
|
307 |
#dec = dec.strip('"')
|
308 |
out1 = {
|
309 |
'timestamp':ts,
|
310 |
-
'sender': dec['sender'],
|
311 |
-
'recipient': dec['recipient'],
|
312 |
'message': dec['message']
|
313 |
|
314 |
}
|
|
|
234 |
send_mes_btn=gr.Button()
|
235 |
with gr.Column():
|
236 |
block_text = gr.Textbox(label = "System", interactive = False)
|
237 |
+
rec_mes = gr.JSON()
|
238 |
response_json=gr.JSON()
|
239 |
+
|
240 |
+
#rec_mes = gr.Textbox(lines=6)
|
241 |
|
242 |
|
243 |
|
|
|
294 |
|
295 |
dec = crypt.decrypt_trans(ea,im)
|
296 |
print(f'dec === {dec}')
|
297 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
dec=eval(dec)
|
299 |
#json_dec=json.loads(f"{dec}")
|
300 |
#dec = dec.strip('"')
|
301 |
out1 = {
|
302 |
'timestamp':ts,
|
303 |
+
'sender': dec['sender'] if dec['sender'] != address else 'Sender',
|
304 |
+
'recipient': dec['recipient'] if dec['recipient'] != address else 'Recipient',
|
305 |
'message': dec['message']
|
306 |
|
307 |
}
|