You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
1.3 KiB

# -*- coding: utf-8 -*-
"""定位 lanhu_Axure_Mapping_Data 的定义处"""
import io, sys, re
from pathlib import Path
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
P = Path(r'e:\code\crm-backend-matt\.scratch\a7-parity\pages\a7-3-1_线索规则')
# 1. data.js 头部
dj = P / 'files' / 'a7-3-1_线索规则' / 'data.js'
print('=== data.js head ===', dj.exists(), dj.stat().st_size if dj.exists() else '')
print(dj.read_text(encoding='utf-8', errors='replace')[:200])
# 2. HTML 里的出现位置
html = (P / 'a7-3-1_线索规则.html').read_text(encoding='utf-8', errors='replace')
print('=== occurrences in HTML ===')
for m in re.finditer(r'lanhu_Axure_Mapping_Data', html):
s = max(0, m.start() - 80)
print(repr(html[s:m.start() + 60]).replace('\\n', ' ')[:180])
print('---')
# 3. 全部已落盘 js 里搜定义
print('=== search define in local js ===')
hits = []
for f in P.rglob('*.js'):
try:
t = f.read_text(encoding='utf-8', errors='replace')
except Exception:
continue
if 'lanhu_Axure_Mapping_Data' in t:
i = t.find('lanhu_Axure_Mapping_Data')
hits.append((str(f.relative_to(P)), t[max(0, i-60):i+80]))
for rel, ctx in hits[:6]:
print(rel, '::', repr(ctx)[:200])
print('total files hit:', len(hits))