SFM/app/app_config.py
2026-06-22 07:25:27 +03:00

27 lines
822 B
Python

from __future__ import annotations
from pathlib import Path
import streamlit as st
SFM_SMB_BASE_PATH = "//sgo-fc01-r13/inbox-intech"
SFM_DEFAULT_INPUT_DIR = r"Exchange\SMBDEMO\test"
ACCESS_SUPPORT_CONTACT = "администратору СФМ"
USER_PATHS_KEY = "user_input_dirs"
EDIT_PATH_OPEN_KEY = "edit_path_open"
EDIT_PATH_VALUE_KEY = "edit_path_value"
PATH_STORE_FILE = Path(__file__).resolve().parents[1] / ".user_paths.json"
def resolve_user_id() -> str:
profile = st.session_state.get("user_profile", {})
if not isinstance(profile, dict):
return "anonymous|anonymous"
email = str(
profile.get("email") or profile.get("preferred_username") or "anonymous"
)
full_name = str(profile.get("name") or profile.get("full_name") or "anonymous")
return f"{email}|{full_name}"