Passed
Push — master ( 7596de...7d2c3d )
by Simon
04:29
created

main()   B

Complexity

Conditions 6

Size

Total Lines 30
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 23
nop 0
dl 0
loc 30
rs 8.3946
c 0
b 0
f 0
1
# Author: Simon Blanke
2
# Email: [email protected]
3
# License: MIT License
4
5
import sys
6
import time
7
import streamlit as st
8
9
10
from streamlit_backend import StreamlitBackend
11
12
13
def main():
14
    try:
15
        st.set_page_config(page_title="Hyperactive Progress Board", layout="wide")
16
    except:
17
        pass
18
19
    search_ids = sys.argv[1:]
20
    backend = StreamlitBackend(search_ids)
21
22
    for search_id in search_ids:
23
        st.title(search_id)
24
        st.components.v1.html(
25
            """<hr style="height:1px;border:none;color:#333;background-color:#333;" /> """,
26
            height=10,
27
        )
28
        col1, col2 = st.beta_columns([1, 2])
29
30
        pyplot_fig, plotly_fig = backend.create_plots(search_id)
31
32
        if pyplot_fig is not None:
33
            col1.pyplot(pyplot_fig)
34
        if plotly_fig is not None:
35
            col2.plotly_chart(plotly_fig)
36
37
        for _ in range(3):
38
            st.write(" ")
39
40
    time.sleep(1)
41
    print("\nStart next run:")
42
    st.experimental_rerun()
43
44
45
if __name__ == "__main__":
46
    main()
47