-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
32 lines (22 loc) · 840 Bytes
/
main.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
from typing import Dict, Type
import streamlit as st
from src import pages
from src.utils import Page, get_file_content_as_string, provide_state
PAGE_MAP: Dict[str, Type[Page]] = {
"Audio Analysis": pages.AudioAnalysis,
"Page 1": pages.Page1,
"Page 2": pages.Page2
}
@provide_state()
def main(state=None):
st.set_page_config(page_title="Sonar Analyzer", layout="centered")
readme_text = st.markdown(get_file_content_as_string("docs/instructions.md"))
st.sidebar.header("Sonar Analyzer")
current_page = st.sidebar.selectbox("Menu", ["Home"] + list(PAGE_MAP))
if current_page == "Home":
st.sidebar.success('To continue select an option aboce.')
else:
readme_text.empty()
PAGE_MAP.get(current_page, pages.Default)(state=state).write()
if __name__ == "__main__":
main()