add input dir

This commit is contained in:
Raykov-MS 2026-07-13 16:10:05 +03:00
parent 6403f5f585
commit 2e5f9a1514

10
main.py
View File

@ -11,6 +11,7 @@ from app.path_settings import (
render_path_editor, render_path_editor,
) )
from app.path_store import set_user_path from app.path_store import set_user_path
from app.pipeline.config import join_path
from app.pipeline.service import run_batch from app.pipeline.service import run_batch
from app.samba_access import check_access_and_list_files from app.samba_access import check_access_and_list_files
@ -46,9 +47,10 @@ def main() -> None:
edited_path = render_path_editor() edited_path = render_path_editor()
if edited_path is not None: if edited_path is not None:
edited_input_dir = join_path(edited_path, "Input")
ok, message, _ = check_access_and_list_files( ok, message, _ = check_access_and_list_files(
smb_base_path=SFM_SMB_BASE_PATH, smb_base_path=SFM_SMB_BASE_PATH,
input_dir=edited_path, input_dir=edited_input_dir,
samba_user=samba_user, samba_user=samba_user,
samba_password=samba_password, samba_password=samba_password,
) )
@ -60,7 +62,9 @@ def main() -> None:
else: else:
st.error(_format_access_error(message)) st.error(_format_access_error(message))
resolved_input_dir = get_resolved_input_dir(user_id) resolved_input_dir = get_resolved_input_dir(user_id)
processing_input_dir = join_path(resolved_input_dir, "Input")
st.caption(f"Текущий путь: `{resolved_input_dir}`") st.caption(f"Текущий путь: `{resolved_input_dir}`")
st.caption(f"Папка чтения XML: `{processing_input_dir}`")
if st.button( if st.button(
"Запустить обработку xml в excel", "Запустить обработку xml в excel",
@ -71,7 +75,7 @@ def main() -> None:
launcher_name = samba_user.strip() or user_id launcher_name = samba_user.strip() or user_id
batch_result = run_batch( batch_result = run_batch(
smb_base_path=SFM_SMB_BASE_PATH, smb_base_path=SFM_SMB_BASE_PATH,
input_dir=resolved_input_dir, input_dir=processing_input_dir,
samba_user=samba_user, samba_user=samba_user,
samba_password=samba_password, samba_password=samba_password,
launcher=launcher_name, launcher=launcher_name,
@ -99,7 +103,7 @@ def main() -> None:
if st.button("Проверить доступ к папке", use_container_width=True): if st.button("Проверить доступ к папке", use_container_width=True):
ok, message, files = check_access_and_list_files( ok, message, files = check_access_and_list_files(
smb_base_path=SFM_SMB_BASE_PATH, smb_base_path=SFM_SMB_BASE_PATH,
input_dir=resolved_input_dir, input_dir=processing_input_dir,
samba_user=samba_user, samba_user=samba_user,
samba_password=samba_password, samba_password=samba_password,
) )