поправлены породы
Gitea Actions Demo / build_and_push (push) Has been cancelled Details

This commit is contained in:
artem 2026-01-15 10:12:00 +03:00
parent b333fad3c5
commit 5651f3c5a6
2 changed files with 952 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from uuid import uuid4
"""
import_beerds_sql.py
@ -58,6 +58,11 @@ def build_breed_map(desc_dir: pathlib.Path, sign_dir: pathlib.Path) -> dict:
"""Возвращает dict: stem → (description, signs)"""
desc_files = {p.stem: p for p in desc_dir.glob("*.txt")}
sign_files = {p.stem: p for p in sign_dir.glob("*.txt")}
for key in desc_files:
if key in sign_files:
continue
sign_files[key] = None
common_keys = desc_files.keys() & sign_files.keys()
if not common_keys:
@ -74,7 +79,10 @@ def build_breed_map(desc_dir: pathlib.Path, sign_dir: pathlib.Path) -> dict:
print(f"Не удалось прочитать описание {desc_path}: {e}")
continue
try:
signs = read_json_file(sign_path)
if sign_path is not None:
signs = read_json_file(sign_path)
else:
signs = {}
except Exception as e:
print(f"Не удалось прочитать сигналы {sign_path}: {e}")
continue

File diff suppressed because it is too large Load Diff