SlimG commited on
Commit
69adff3
·
1 Parent(s): 438a969

factorize page configuration

Browse files
app/1_Prédictions.py CHANGED
@@ -1,15 +1,11 @@
1
  from datetime import date
 
 
2
  import streamlit as st
 
3
 
4
- # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
5
- st.set_page_config(
6
- layout="wide",
7
- page_title="Prédictions",
8
- page_icon="🎾",
9
- )
10
 
11
- import random # noqa: E402
12
- from typing import Literal # noqa: E402
13
  from app.utils import authenticated, get_all_models_options # noqa: E402
14
  from app.api import ( # noqa: E402
15
  get_prediction as get_prediction_api
 
1
  from datetime import date
2
+ import random
3
+ from typing import Literal
4
  import streamlit as st
5
+ from app.config import config_page
6
 
7
+ config_page(title="Prédictions")
 
 
 
 
 
8
 
 
 
9
  from app.utils import authenticated, get_all_models_options # noqa: E402
10
  from app.api import ( # noqa: E402
11
  get_prediction as get_prediction_api
app/config.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
4
+ def config_page(title="Prédictions"):
5
+ st.set_page_config(
6
+ layout="wide",
7
+ page_title=title,
8
+ page_icon="🎾",
9
+ )
app/pages/2_Archives.py CHANGED
@@ -1,14 +1,11 @@
 
 
 
1
  import streamlit as st
 
2
 
3
- st.set_page_config(
4
- layout="wide",
5
- page_title="Archives",
6
- page_icon="🎾",
7
- )
8
 
9
- from typing import Dict # noqa: E402
10
- import pandas as pd # noqa: E402
11
- from datetime import datetime # noqa: E402
12
  from app.utils import ( # noqa: E402
13
  authenticated,
14
  get_all_tournaments_options,
 
1
+ from typing import Dict
2
+ import pandas as pd
3
+ from datetime import datetime
4
  import streamlit as st
5
+ from app.config import config_page
6
 
7
+ config_page(title="Archives")
 
 
 
 
8
 
 
 
 
9
  from app.utils import ( # noqa: E402
10
  authenticated,
11
  get_all_tournaments_options,