mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix: Filter meshcli prompt lines to eliminate false WARN results
Prompt lines (DeviceName|* ...) and summary lines (> N contacts) are normal meshcli output, not format changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -155,7 +155,8 @@ class CompatChecker:
|
||||
for line in stdout.split('\n'):
|
||||
line_stripped = line.strip()
|
||||
if not line_stripped or line_stripped.startswith('---') or \
|
||||
line.lower().startswith('contact') or line.startswith('INFO:'):
|
||||
line.lower().startswith('contact') or line.startswith('INFO:') or \
|
||||
self._is_prompt_line(line_stripped):
|
||||
continue
|
||||
|
||||
parts = CONTACTS_SPLIT_REGEX.split(line)
|
||||
@@ -291,7 +292,7 @@ class CompatChecker:
|
||||
unparsed = []
|
||||
for line in stdout.split('\n'):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
if not line or self._is_prompt_line(line):
|
||||
continue
|
||||
match = CHANNEL_REGEX.match(line)
|
||||
if match:
|
||||
@@ -409,6 +410,17 @@ class CompatChecker:
|
||||
|
||||
# ── Helpers ───────────────────────────────────────────────────
|
||||
|
||||
@staticmethod
|
||||
def _is_prompt_line(line):
|
||||
"""Check if line is a meshcli prompt or summary (not actual data)."""
|
||||
# Prompt lines: "DeviceName|* command" or "DeviceName|*"
|
||||
if '|*' in line:
|
||||
return True
|
||||
# Summary lines: "> 310 contacts in device"
|
||||
if line.startswith('>'):
|
||||
return True
|
||||
return False
|
||||
|
||||
def _extract_json_object(self, text):
|
||||
"""Extract first complete JSON object from text using brace-matching."""
|
||||
depth = 0
|
||||
|
||||
Reference in New Issue
Block a user