Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -453,20 +453,36 @@ def comp_1(comp_list=comp_list,col=3,row=4,resize=[640,450]):
|
|
453 |
#1280x900
|
454 |
outp=comp_combine(comp_list,col,row,resize)
|
455 |
return (outp)
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
def get_time():
|
460 |
datetimestamp=str(datetime.datetime.now()).split(".")[0]
|
461 |
datestamp=datetimestamp.replace(" ","-").split("-")
|
462 |
timestamp=datestamp[3].split(":")
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
|
465 |
with gr.Blocks() as app:
|
466 |
-
datetimestamp=gr.
|
467 |
-
datestamp=gr.
|
468 |
-
timestamp=gr.State()
|
469 |
-
|
|
|
|
|
470 |
|
471 |
time_html=gr.HTML(f"""<div style='font-size:xxx-large;'>Current: {datetimestamp} UTC</div>""")
|
472 |
with gr.Tab("NOAA"):
|
@@ -535,6 +551,7 @@ with gr.Blocks() as app:
|
|
535 |
with gr.Tab("SOHO Video"):
|
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 ##########
|
|
|
453 |
#1280x900
|
454 |
outp=comp_combine(comp_list,col,row,resize)
|
455 |
return (outp)
|
456 |
+
datestamp=["1","1","1"]
|
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 |
+
|
464 |
+
html_out=f"""<div style='font-size:xxx-large;'>Current: {datetimestamp} UTC</div>"""
|
465 |
+
year1=int(datestamp[0])
|
466 |
+
month1=int(datestamp[1])
|
467 |
+
day1=int(datestamp[2])
|
468 |
+
hour1=int(timestamp[0])
|
469 |
+
minute1=int(timestamp[1])
|
470 |
+
year2=int(datestamp[0])
|
471 |
+
month2=int(datestamp[1])
|
472 |
+
day2=int(datestamp[2])
|
473 |
+
hour2=int(timestamp[0])
|
474 |
+
minute2=int(timestamp[1])
|
475 |
+
return gr.update(html_out),gr.update(year1),gr.update(month1),
|
476 |
+
gr.update(day1),gr.update(hour1),gr.update(minute1),
|
477 |
+
gr.update(year2),gr.update(month2),gr.update(day2),gr.update(hour2),gr.update(minute2)
|
478 |
|
479 |
with gr.Blocks() as app:
|
480 |
+
#datetimestamp=gr.Textbox()
|
481 |
+
#datestamp=gr.Textbox()
|
482 |
+
#timestamp=gr.State()
|
483 |
+
datetimestamp=str(datetime.datetime.now()).split(".")[0]
|
484 |
+
datestamp=datetimestamp.replace(" ","-").split("-")
|
485 |
+
timestamp=datestamp[3].split(":")
|
486 |
|
487 |
time_html=gr.HTML(f"""<div style='font-size:xxx-large;'>Current: {datetimestamp} UTC</div>""")
|
488 |
with gr.Tab("NOAA"):
|
|
|
551 |
with gr.Tab("SOHO Video"):
|
552 |
soho_vid_btn=gr.Button("Load")
|
553 |
html_vid_nasa=gr.HTML()
|
554 |
+
app.load(get_time,None,[time_html,year1,month1,day1,hour1,minute1,year2,month2,day2,hour2,minute2])
|
555 |
|
556 |
first_comp_btn.click(comp_1,None,first_comp_img)
|
557 |
###### Composite Images ##########
|