| d = open('app/ui.py', 'rb').read() |
|
|
| old = b"sampleRows = text.split('\\n').filter(l => l.trim() && !l.startsWith('--')).slice(0, 5);\r\n headers = ['(SQL dump \xe2\x80\x94 columns detected automatically)'];" |
|
|
| new = b'sampleRows = text.split(String.fromCharCode(10)).filter(l => l.trim() && !l.startsWith("--")).slice(0, 5);\r\n headers = ["(SQL dump - columns detected automatically)"];' |
|
|
| print('found:', old in d) |
| if old in d: |
| d2 = d.replace(old, new) |
| open('app/ui.py', 'wb').write(d2) |
| print('written, size:', len(d2)) |
| else: |
| |
| i = d.find(b'sampleRows = text.split') |
| print('nearby:', repr(d[i:i+120])) |
|
|