-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.py
50 lines (37 loc) · 1.42 KB
/
ui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import streamlit as st
import numpy as np
from modules.ui_screens import ui_csv_import, ui_actors, ui_scenes, ui_schedule
import logging
logging.basicConfig(level=logging.INFO)
logging.debug("initializing session states")
# Initialize streamlit session states
def check_and_init_session_state(state):
if state not in st.session_state:
st.session_state[state] = []
for state in ["actors", "requirements", "dates", "indexes", "date_range"]:
check_and_init_session_state(state)
if "np_availabilities" not in st.session_state:
st.session_state["np_availabilities"] = np.array([])
if "active_scenes" not in st.session_state:
st.session_state["active_scenes"] = {}
if "scenes" not in st.session_state:
st.session_state["scenes"] = {}
if "actor_scaling" not in st.session_state:
st.session_state["actor_scaling"] = 1.0
if "session_state_new_actor" not in st.session_state:
st.session_state["new_actor"] = False
#### Start UI ####
st.title("Hello and welcome to the Schedule Generator")
st.caption("*also known as the susi de-insanator")
with st.expander("CSV Import:"):
logging.debug("rendering CSV screen")
ui_csv_import()
with st.expander("Actors:"):
logging.debug("rendering Actors screen")
ui_actors()
with st.expander("Scenes:"):
logging.debug("rendering Scenes screen")
ui_scenes()
with st.expander("Schedule"):
logging.debug("rendering Schedule screen")
ui_schedule()