Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 3, 2024
1 parent 7785672 commit 7dd6747
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/st_pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
]
Expand All @@ -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)
Expand All @@ -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,
)
)
Expand All @@ -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
return pages_data

0 comments on commit 7dd6747

Please sign in to comment.