feat: поддержка .gge, .esw, .xml в пакетном обработчике
Файлы сметных программ (ГРАНД-Смета .gge/.esw) — это XML. Теперь extract_zip, batch_v2, batch_v3 находят и обрабатывают все сметные форматы: .xlsx, .xls, .gge, .esw, .xml GGE/ESW копируются как XML без xlsx-конвертации. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+13
-6
@@ -69,12 +69,14 @@ def verify_script(
|
||||
Returns {"ok": True/False, "processed": int, "errors": [...], "error": str}.
|
||||
"""
|
||||
job_dir = Path(job_dir)
|
||||
# Select 2 sample xlsx files
|
||||
all_xlsx = sorted(
|
||||
f for f in Path(source_dir).rglob("*.xlsx")
|
||||
if not f.name.startswith("~$") and not f.name.startswith("._")
|
||||
SMETA_EXT = {'.xlsx', '.xls', '.gge', '.esw', '.xml'}
|
||||
# Select 2 sample files
|
||||
all_files = sorted(
|
||||
f for f in Path(source_dir).rglob("*")
|
||||
if f.is_file() and f.suffix.lower() in SMETA_EXT
|
||||
and not f.name.startswith("~$") and not f.name.startswith("._")
|
||||
)
|
||||
samples = [str(f) for f in all_xlsx[:2]]
|
||||
samples = [str(f) for f in all_files[:2]]
|
||||
if not samples:
|
||||
return {"ok": False, "error": "No xlsx files found in source", "processed": 0, "errors": []}
|
||||
|
||||
@@ -319,7 +321,12 @@ def run_batch_v3(job_id: str, script: str, source_dir: str, target_file: str):
|
||||
job["status"] = "running"
|
||||
job["started_at"] = time.time()
|
||||
|
||||
source_files = [str(f) for f in Path(source_dir).rglob("*.xlsx") if not f.name.startswith("~$")]
|
||||
SMETA_EXT = {'.xlsx', '.xls', '.gge', '.esw', '.xml'}
|
||||
source_files = [
|
||||
str(f) for f in Path(source_dir).rglob("*")
|
||||
if f.is_file() and f.suffix.lower() in SMETA_EXT
|
||||
and not f.name.startswith("~$") and not f.name.startswith("._")
|
||||
]
|
||||
job["total_files"] = len(source_files)
|
||||
job["processed"] = 0
|
||||
job["errors"] = []
|
||||
|
||||
Reference in New Issue
Block a user