Omnibus commited on
Commit
7bda97a
·
1 Parent(s): 32e541c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -292,22 +292,23 @@ with gr.Blocks() as app:
292
 
293
  dec = crypt.decrypt_trans(ea,im)
294
  print(f'dec === {dec}')
295
- string = dec.strip('{}')
 
296
  # split the string into key-value pairs
297
- pairs = string.split(', ')
298
- print(f'PAIRS ::: {pairs}')
299
- json_dec = {key1[1:-2]: str(value) for key1, value in (pair.split(': ') for pair in pairs)}
300
  #print(f'KEY ::: {key}')
301
  #print(f'VALUE ::: {value}')
302
-
303
 
304
  #json_dec=json.loads(f"{dec}")
305
  #dec = dec.strip('"')
306
  out1 = {
307
  'timestamp':ts,
308
- 'sender': json_dec['sender'],
309
- 'recipient': json_dec['recipient'],
310
- 'message': json_dec['message']
311
 
312
  }
313
  out.append(out1)
 
292
 
293
  dec = crypt.decrypt_trans(ea,im)
294
  print(f'dec === {dec}')
295
+ dec=dec.strip('"').strip('{}')
296
+ #string = dec.strip('{}')
297
  # split the string into key-value pairs
298
+ # pairs = string.split(', ')
299
+ # print(f'PAIRS ::: {pairs}')
300
+ # json_dec = {key1[1:-2]: str(value) for key1, value in (pair.split(': ') for pair in pairs)}
301
  #print(f'KEY ::: {key}')
302
  #print(f'VALUE ::: {value}')
303
+ dec={dec}
304
 
305
  #json_dec=json.loads(f"{dec}")
306
  #dec = dec.strip('"')
307
  out1 = {
308
  'timestamp':ts,
309
+ 'sender': dec['sender'],
310
+ 'recipient': dec['recipient'],
311
+ 'message': dec['message']
312
 
313
  }
314
  out.append(out1)