Omnibus commited on
Commit
74b35ce
·
verified ·
1 Parent(s): 26f0a33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -457,14 +457,16 @@ def comp_1(comp_list=comp_list,col=3,row=4,resize=[640,450]):
457
  #timestamp=["1","1","1"]
458
  #datetimestamp="1:1:1"
459
  def get_time():
460
- #datetimestamp=str(datetime.datetime.now()).split(".")[0]
461
- #datestamp=datetimestamp.replace(" ","-").split("-")
462
- #timestamp=datestamp[3].split(":")
463
- return gr.update()
464
- with gr.Blocks() as app:
465
- datetimestamp=gr.State(str(datetime.datetime.now()).split(".")[0])
466
- datestamp=str(datetimestamp).replace(" ","-").split("-")
467
  timestamp=datestamp[3].split(":")
 
 
 
 
 
 
 
468
 
469
  time_html=gr.HTML(f"""<div style='font-size:xxx-large;'>Current: {datetimestamp} UTC</div>""")
470
  with gr.Tab("NOAA"):
@@ -534,7 +536,6 @@ with gr.Blocks() as app:
534
  soho_vid_btn=gr.Button("Load")
535
  html_vid_nasa=gr.HTML()
536
 
537
- #app.load(get_time,None,[datetimestamp])
538
  first_comp_btn.click(comp_1,None,first_comp_img)
539
  ###### Composite Images ##########
540
  comp_combine_btn.click(comp_combine,[image_comp_list,comp_col,comp_row],img_out)
 
457
  #timestamp=["1","1","1"]
458
  #datetimestamp="1:1:1"
459
  def get_time():
460
+ datetimestamp=str(datetime.datetime.now()).split(".")[0]
461
+ datestamp=datetimestamp.replace(" ","-").split("-")
 
 
 
 
 
462
  timestamp=datestamp[3].split(":")
463
+ return gr.update(datetimestamp),gr.update(datestamp),gr.update(timestamp)
464
+
465
+ with gr.Blocks() as app:
466
+ datetimestamp=gr.State()
467
+ datestamp=gr.State()
468
+ timestamp=gr.State()
469
+ app.load(get_time,None,[datetimestamp,datestamp,timestamp])
470
 
471
  time_html=gr.HTML(f"""<div style='font-size:xxx-large;'>Current: {datetimestamp} UTC</div>""")
472
  with gr.Tab("NOAA"):
 
536
  soho_vid_btn=gr.Button("Load")
537
  html_vid_nasa=gr.HTML()
538
 
 
539
  first_comp_btn.click(comp_1,None,first_comp_img)
540
  ###### Composite Images ##########
541
  comp_combine_btn.click(comp_combine,[image_comp_list,comp_col,comp_row],img_out)