style: apply ruff auto-fixes
This commit is contained in:
19
scripts/check_pattern.py
Normal file
19
scripts/check_pattern.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import re
|
||||
from pathlib import Path
|
||||
p = Path(r'c:\Forgejo\Medios-Macina\CLI.py')
|
||||
s = p.read_text(encoding='utf-8')
|
||||
pattern = re.compile(r'(?s)if False:\s*class _OldPipelineExecutor:.*?from rich\\.markdown import Markdown\\s*')
|
||||
m = pattern.search(s)
|
||||
print('found', bool(m))
|
||||
if m:
|
||||
print('start', m.start(), 'end', m.end())
|
||||
print('snippet:', s[m.start():m.start()+120])
|
||||
else:
|
||||
# print a slice around the if False for debugging
|
||||
i = s.find('if False:')
|
||||
print('if False index', i)
|
||||
print('around if False:', s[max(0,i-50):i+200])
|
||||
j = s.find('from rich.markdown import Markdown', i)
|
||||
print('next from rich index after if False', j)
|
||||
if j!=-1:
|
||||
print('around that:', s[j-50:j+80])
|
||||
Reference in New Issue
Block a user