Skip to content

Commit

Permalink
Add logging to update_enabled_module function
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinchai committed Mar 29, 2024
1 parent 5942a4c commit 8d68ea3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webui/templates/0_Base_Settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import streamlit as st
from streamlit import session_state
import logging

from webui.functions.addons import update_pages
from webui.functions.common_field import create_ui_for_dataclass
Expand All @@ -13,19 +14,19 @@
st.markdown("# Base Settings")
create_ui_for_dataclass(SettingManager.BaseSettings)

st.markdown("*Submission files are temporarily disabled*")
st.warning("*Submission files are temporarily disabled*")


def update_enabled_module():
print(
logging.debug(
f"Updating enabled module from {SettingManager.BaseSettings.enabled_module} to {session_state.enabled_module}")
with st.spinner("Loading..."):
with update_addon_lock:
SettingManager.BaseSettings.enabled_module = session_state.enabled_module
AddonManager.update_enabled_module()
SettingManager.save_settings()
update_pages()
print(f"Enabled module: {SettingManager.BaseSettings.enabled_module}")
logging.debug(f"Enabled module: {SettingManager.BaseSettings.enabled_module}")


# selection for module
Expand Down Expand Up @@ -55,4 +56,4 @@ def update_enabled_plugins(changed_plugin_name):
st.toggle(plugin_name, plugin_name in SettingManager.BaseSettings.enabled_plugins, key=plugin_name,
on_change=update_enabled_plugins, args=(plugin_name,))

print("Base settings rendered")
logging.debug("Base settings rendered")

0 comments on commit 8d68ea3

Please sign in to comment.