saving-willy-dev / src /apptest /demo_elements.py
rmm
fix: all usage of session_state.files explicitly a list now
c860c9c
raw
history blame
918 Bytes
# a small library of elements used in testing, presenting some
# processed data in simple ways that are easily testable via AppTest
from typing import List
import streamlit as st
from input.input_handling import (
get_image_datetime, get_image_latlon
)
def show_uploaded_file_info():
if "file_uploader_data" not in st.session_state or \
not st.session_state.file_uploader_data:
st.write("No files uploaded yet")
return
st.write("the buffered files:")
uploaded_files:List = st.session_state.file_uploader_data
for ix, file in enumerate(uploaded_files):
image_datetime_raw = get_image_datetime(file)
latitude0, longitude0 = get_image_latlon(file)
s = f"index: {ix}, name: {file.name}, datetime: {image_datetime_raw}, lat: {latitude0}, lon:{longitude0}"
st.text_area(f"{file.name}", value=s, key=f"metadata_{ix}")
print(s)