fix: skip .doc binary files unchanged + bump v0.4/v1.0.187
Deploy contracts-flask / validate (push) Successful in 0s
Deploy contracts-flask / validate (push) Successful in 0s
This commit is contained in:
@@ -208,6 +208,9 @@ class TwoPassObfuscator:
|
|||||||
all_texts[fname] = text
|
all_texts[fname] = text
|
||||||
if doc is not None:
|
if doc is not None:
|
||||||
all_docx[fname] = doc
|
all_docx[fname] = doc
|
||||||
|
elif text == "[DOC binary — not parsed]":
|
||||||
|
pass # .doc без изменений
|
||||||
|
else:
|
||||||
self._scan_regex(text)
|
self._scan_regex(text)
|
||||||
|
|
||||||
if self._llm_client:
|
if self._llm_client:
|
||||||
@@ -217,7 +220,10 @@ class TwoPassObfuscator:
|
|||||||
results = []
|
results = []
|
||||||
for fname, content, ctype in files:
|
for fname, content, ctype in files:
|
||||||
obf_content = content
|
obf_content = content
|
||||||
if fname in all_docx:
|
if fname.endswith('.doc'):
|
||||||
|
# .doc — бинарный, оставляем как есть
|
||||||
|
pass
|
||||||
|
elif fname in all_docx:
|
||||||
obf_content = self._replace_in_docx(all_docx[fname])
|
obf_content = self._replace_in_docx(all_docx[fname])
|
||||||
elif fname.endswith('.pdf'):
|
elif fname.endswith('.pdf'):
|
||||||
txt = all_texts.get(fname, '')
|
txt = all_texts.get(fname, '')
|
||||||
@@ -310,8 +316,10 @@ class TwoPassObfuscator:
|
|||||||
text += "\n" + " | ".join(str(c) if c else "" for c in row)
|
text += "\n" + " | ".join(str(c) if c else "" for c in row)
|
||||||
|
|
||||||
elif ext == '.doc':
|
elif ext == '.doc':
|
||||||
# .doc: читаем как текст (конвертация через libreoffice не используется)
|
# .doc — бинарный формат, без libreoffice не парсим
|
||||||
text = content.decode('utf-8', errors='replace')
|
# Пропускаем без изменений (не обфусцируем)
|
||||||
|
text = "[DOC binary — not parsed]"
|
||||||
|
return text, None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
text = content.decode('utf-8', errors='replace')
|
text = content.decode('utf-8', errors='replace')
|
||||||
|
|||||||
@@ -208,6 +208,9 @@ class TwoPassObfuscator:
|
|||||||
all_texts[fname] = text
|
all_texts[fname] = text
|
||||||
if doc is not None:
|
if doc is not None:
|
||||||
all_docx[fname] = doc
|
all_docx[fname] = doc
|
||||||
|
elif text == "[DOC binary — not parsed]":
|
||||||
|
pass # .doc без изменений
|
||||||
|
else:
|
||||||
self._scan_regex(text)
|
self._scan_regex(text)
|
||||||
|
|
||||||
if self._llm_client:
|
if self._llm_client:
|
||||||
@@ -217,7 +220,10 @@ class TwoPassObfuscator:
|
|||||||
results = []
|
results = []
|
||||||
for fname, content, ctype in files:
|
for fname, content, ctype in files:
|
||||||
obf_content = content
|
obf_content = content
|
||||||
if fname in all_docx:
|
if fname.endswith('.doc'):
|
||||||
|
# .doc — бинарный, оставляем как есть
|
||||||
|
pass
|
||||||
|
elif fname in all_docx:
|
||||||
obf_content = self._replace_in_docx(all_docx[fname])
|
obf_content = self._replace_in_docx(all_docx[fname])
|
||||||
elif fname.endswith('.pdf'):
|
elif fname.endswith('.pdf'):
|
||||||
txt = all_texts.get(fname, '')
|
txt = all_texts.get(fname, '')
|
||||||
@@ -310,8 +316,10 @@ class TwoPassObfuscator:
|
|||||||
text += "\n" + " | ".join(str(c) if c else "" for c in row)
|
text += "\n" + " | ".join(str(c) if c else "" for c in row)
|
||||||
|
|
||||||
elif ext == '.doc':
|
elif ext == '.doc':
|
||||||
# .doc: читаем как текст (конвертация через libreoffice не используется)
|
# .doc — бинарный формат, без libreoffice не парсим
|
||||||
text = content.decode('utf-8', errors='replace')
|
# Пропускаем без изменений (не обфусцируем)
|
||||||
|
text = "[DOC binary — not parsed]"
|
||||||
|
return text, None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
text = content.decode('utf-8', errors='replace')
|
text = content.decode('utf-8', errors='replace')
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<a href="/">Сверка договоров</a>
|
<a href="/">Сверка договоров</a>
|
||||||
<span class="sep">|</span>
|
<span class="sep">|</span>
|
||||||
<strong>DrHider</strong>
|
<strong>DrHider</strong>
|
||||||
<span style="font-size:11px;color:var(--muted);">v0.3</span>
|
<span style="font-size:11px;color:var(--muted);">v0.4</span>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="topbar">
|
<div class="topbar">
|
||||||
<img src="/static/logo.svg" alt="Nubes">
|
<img src="/static/logo.svg" alt="Nubes">
|
||||||
<span class="title">Сверка договоров — LLM AI-driven Event Sourcing <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.186-flask</span></span>
|
<span class="title">Сверка договоров — LLM AI-driven Event Sourcing <span style="font-weight:400;color:var(--muted);font-size:12px;">v1.0.187-flask</span></span>
|
||||||
<div id="pipelineStepper" style="display:flex;gap:8px;font-size:11px;align-items:center;color:var(--muted);">
|
<div id="pipelineStepper" style="display:flex;gap:8px;font-size:11px;align-items:center;color:var(--muted);">
|
||||||
<span id="stepUpload">○ Загрузка</span><span>→</span>
|
<span id="stepUpload">○ Загрузка</span><span>→</span>
|
||||||
<span id="stepClassify">○ Классификация</span><span>→</span>
|
<span id="stepClassify">○ Классификация</span><span>→</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user