Omnibus commited on
Commit
c721296
·
verified ·
1 Parent(s): 5b2b36d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -11,16 +11,16 @@ PAGE_LINK
11
  def load_json(url1="",url2="",url3="",url4=""):
12
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
13
  print(f'{get_url}')
14
- if get_url.endswith('.json"'):
15
  feed1 = requests.get(get_url)
16
  return feed1.text
17
-
18
  def make_tree(url1="",url2="",url3="",url4=""):
19
  link_box=[]
20
  html_out=""
21
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
22
  print(f'######### :: {get_url}')
23
- if not get_url.endswith('.json"'):
24
  feed1 = requests.get(get_url)
25
  spl = feed1.text.split("href=")
26
  for line in spl:
@@ -31,7 +31,8 @@ def make_tree(url1="",url2="",url3="",url4=""):
31
  link_box.append(fin)
32
  #html_out=html_out+html.replace("PAGE_LINK",fin)
33
  return gr.update(choices=[l for l in link_box],interactive=True)
34
-
 
35
  def run():
36
  out=make_tree()
37
  return out
 
11
  def load_json(url1="",url2="",url3="",url4=""):
12
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
13
  print(f'{get_url}')
14
+ if get_url.endswith('.json'):
15
  feed1 = requests.get(get_url)
16
  return feed1.text
17
+ return None
18
  def make_tree(url1="",url2="",url3="",url4=""):
19
  link_box=[]
20
  html_out=""
21
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
22
  print(f'######### :: {get_url}')
23
+ if not get_url.endswith('.json'):
24
  feed1 = requests.get(get_url)
25
  spl = feed1.text.split("href=")
26
  for line in spl:
 
31
  link_box.append(fin)
32
  #html_out=html_out+html.replace("PAGE_LINK",fin)
33
  return gr.update(choices=[l for l in link_box],interactive=True)
34
+ else:
35
+ return None
36
  def run():
37
  out=make_tree()
38
  return out