Omnibus commited on
Commit
9bb3b94
1 Parent(s): 4b12a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -10,7 +10,10 @@ import json
10
  def read_rss():
11
  f = open('feeds_sorted.json')
12
  data = json.load(f)
13
- return data
 
 
 
14
 
15
  def find_rss(rss_url):
16
  json_box=[]
@@ -50,8 +53,10 @@ with gr.Blocks() as app:
50
  rss = gr.Textbox(label="rss")
51
  btn = gr.Button("load rss")
52
  r_btn=gr.Button("read")
53
- out_json = gr.Textbox()
54
- r_btn.click(read_rss,None,out_json)
 
 
55
  search_btn.click(find_rss,rss_search,out_json)
56
  btn.click(get_rss,rss,out_json)
57
  app.launch()
 
10
  def read_rss():
11
  f = open('feeds_sorted.json')
12
  data = json.load(f)
13
+ with open('tmp.json','w') as f:
14
+ json.dumps(data, f, indent=4)
15
+ f.close()
16
+ return data, ['tmp.json']
17
 
18
  def find_rss(rss_url):
19
  json_box=[]
 
53
  rss = gr.Textbox(label="rss")
54
  btn = gr.Button("load rss")
55
  r_btn=gr.Button("read")
56
+ with gr.Row():
57
+ out_json = gr.Textbox()
58
+ fil = gr.Files()
59
+ r_btn.click(read_rss,None,[out_json,fil])
60
  search_btn.click(find_rss,rss_search,out_json)
61
  btn.click(get_rss,rss,out_json)
62
  app.launch()