diff --git a/src/st_pages/__init__.py b/src/st_pages/__init__.py index b6e4efb..048e58c 100644 --- a/src/st_pages/__init__.py +++ b/src/st_pages/__init__.py @@ -39,7 +39,7 @@ def translate_icon(icon: str | None) -> str | None: def _get_nav_from_toml( - path: str = ".streamlit/pages.toml", + path: str = ".streamlit/pages.toml", ) -> list[StreamlitPage] | dict[str, list[StreamlitPage]]: """ Given a path to a TOML file, return a list or dictionary that can be passed to @@ -57,8 +57,8 @@ def _get_nav_from_toml( p for p in pages if ( - p.name not in st.session_state[HIDE_PAGES_KEY] - and str(p.name).replace("_", " ") not in st.session_state[HIDE_PAGES_KEY] + p.name not in st.session_state[HIDE_PAGES_KEY] + and str(p.name).replace("_", " ") not in st.session_state[HIDE_PAGES_KEY] ) or p.is_section ] @@ -76,7 +76,7 @@ def _get_nav_from_toml( for page in pages: if page.is_section: - if hasattr(page, 'icon') and page.icon != "": + if hasattr(page, "icon") and page.icon != "": current_section = f"{translate_icon(page.icon)} {page.name}" else: current_section = cast(str, page.name) @@ -89,7 +89,7 @@ def _get_nav_from_toml( st.Page( page.path, title=page.name, - icon=translate_icon(page.icon if hasattr(page, 'icon') else None), + icon=translate_icon(page.icon if hasattr(page, "icon") else None), url_path=page.url_path, ) ) @@ -104,9 +104,9 @@ def _get_nav_from_toml( st.Page( page.path, title=page.name, - icon=translate_icon(page.icon if hasattr(page, 'icon') else None), + icon=translate_icon(page.icon if hasattr(page, "icon") else None), url_path=page.url_path, ) ) - return pages_data \ No newline at end of file + return pages_data