File size: 776 Bytes
dd64f21
 
 
5e815e0
720467c
fe44fc7
5e815e0
ddb39cb
dd64f21
 
 
 
 
 
 
 
 
 
 
720467c
 
 
 
 
 
dd64f21
fe44fc7
dd64f21
5e815e0
720467c
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
import os
import streamlit as st

from queries.nflverse.github_data import load_assets_if_no_tables
from login import login_by_token
from data_storage import initialize_data_storage


def get_local_style():
    code_str = ""
    with open(os.path.join(os.path.dirname(__file__), "style.css")) as f:
        code_str = "<style>{}</style>".format(f.read())
    return code_str


def local_css():
    return st.markdown(get_local_style(), unsafe_allow_html=True)


def login_token_arg_if_exists():
    url_params = st.experimental_get_query_params()
    if arg_token_list := url_params.get("token"):
        login_by_token(arg_token_list[0])


def common_page_config():
    initialize_data_storage()
    local_css()
    load_assets_if_no_tables()
    login_token_arg_if_exists()