Compare commits
No commits in common. "f8d587275bc47a9e654ce085833201dab7d6fd93" and "d9747380f2630de4c929512557a42222e8c15021" have entirely different histories.
f8d587275b
...
d9747380f2
@ -74,14 +74,15 @@ def run_batch(
|
|||||||
try:
|
try:
|
||||||
ensure_dir_exists(input_dir, samba_conn)
|
ensure_dir_exists(input_dir, samba_conn)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc: # noqa: BLE001
|
||||||
return _build_input_dir_error_result(
|
return BatchResult(
|
||||||
input_dir=input_dir,
|
status="error",
|
||||||
details=str(exc),
|
processed=0,
|
||||||
)
|
partial=0,
|
||||||
if not samba_conn.path_exists(input_dir):
|
errors=1,
|
||||||
return _build_input_dir_error_result(
|
report_path="",
|
||||||
input_dir=input_dir,
|
protocol_path="",
|
||||||
details="Проверьте права на родительский каталог.",
|
log_path="",
|
||||||
|
messages=[f"Не удалось создать входную папку: {input_dir}. {exc}"],
|
||||||
)
|
)
|
||||||
is_ok, access_error = check_input_dir_access(
|
is_ok, access_error = check_input_dir_access(
|
||||||
input_dir=input_dir, samba_conn=samba_conn
|
input_dir=input_dir, samba_conn=samba_conn
|
||||||
@ -448,16 +449,3 @@ def _format_duration(duration_seconds: float) -> str:
|
|||||||
if minutes:
|
if minutes:
|
||||||
return f"{minutes} мин {seconds} сек"
|
return f"{minutes} мин {seconds} сек"
|
||||||
return f"{seconds} сек"
|
return f"{seconds} сек"
|
||||||
|
|
||||||
|
|
||||||
def _build_input_dir_error_result(input_dir: str, details: str) -> BatchResult:
|
|
||||||
return BatchResult(
|
|
||||||
status="error",
|
|
||||||
processed=0,
|
|
||||||
partial=0,
|
|
||||||
errors=1,
|
|
||||||
report_path="",
|
|
||||||
protocol_path="",
|
|
||||||
log_path="",
|
|
||||||
messages=[f"Не удалось создать входную папку: {input_dir}. {details}"],
|
|
||||||
)
|
|
||||||
|
|||||||
@ -35,15 +35,6 @@ def check_access_and_list_files(
|
|||||||
ensure_dir_exists(input_dir, samba_conn=samba_conn)
|
ensure_dir_exists(input_dir, samba_conn=samba_conn)
|
||||||
except Exception as exc: # noqa: BLE001
|
except Exception as exc: # noqa: BLE001
|
||||||
return False, f"Не удалось создать входную папку: {input_dir}. {exc}", []
|
return False, f"Не удалось создать входную папку: {input_dir}. {exc}", []
|
||||||
if not samba_conn.path_exists(input_dir):
|
|
||||||
return (
|
|
||||||
False,
|
|
||||||
(
|
|
||||||
"Не удалось создать входную папку: "
|
|
||||||
f"{input_dir}. Проверьте права на родительский каталог."
|
|
||||||
),
|
|
||||||
[],
|
|
||||||
)
|
|
||||||
|
|
||||||
ok, error = check_input_dir_access(Path(input_dir), samba_conn=samba_conn)
|
ok, error = check_input_dir_access(Path(input_dir), samba_conn=samba_conn)
|
||||||
if not ok:
|
if not ok:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user