Omnibus commited on
Commit
8e9df5c
·
1 Parent(s): cd033af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -378,6 +378,7 @@ def issue_tokens(send,rec,amount):
378
  response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
379
  response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
380
  mes = (f'Send: {message_send} :: Recieve: {message_rec}')
 
381
  return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec)
382
  ############################## MYCHAIN END ###############################
383
 
@@ -406,15 +407,16 @@ def res_source():
406
  return "__Source__ Reset"
407
  except Exception as e:
408
  return e
409
- f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="dataset"))
410
- send_list =[]
411
- for i,ea in enumerate(f_ist):
412
- if "balance/" in ea:
413
- try:
414
- send_list.append(ea.split("/",1)[1].split(".",1)[0])
415
- except Exception:
416
- pass
417
-
 
418
 
419
  with gr.Blocks() as bc:
420
  with gr.Row(visible=True) as invalid:
 
378
  response_send, show_chain_send, message_send = mychain_mine_block_send(balance_send, chain_r=None,chain_n=send)
379
  response_rec, show_chain_rec, message_rec = mychain_mine_block_rec(balance_rec, chain_r=None,chain_n=rec)
380
  mes = (f'Send: {message_send} :: Recieve: {message_rec}')
381
+ update_send_list()
382
  return (mes, p, response_send, response_rec, show_chain_send, show_chain_rec, data_send, data_rec, message_send, message_rec)
383
  ############################## MYCHAIN END ###############################
384
 
 
407
  return "__Source__ Reset"
408
  except Exception as e:
409
  return e
410
+ def update_send_list():
411
+ f_ist = (api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="dataset"))
412
+ send_list =[]
413
+ for i,ea in enumerate(f_ist):
414
+ if "balance/" in ea:
415
+ try:
416
+ send_list.append(ea.split("/",1)[1].split(".",1)[0])
417
+ except Exception:
418
+ pass
419
+ upate_send_list()
420
 
421
  with gr.Blocks() as bc:
422
  with gr.Row(visible=True) as invalid: