##// END OF EJS Templates
Remove the "autoedit_syntax" feature....
Remove the "autoedit_syntax" feature. IPython used to (a long time ago, in a galaxy far far away) have the ability to automatically open an editor in case a wild syntax error appears. The configuration option to enable that was not working for a few years, and apparently we by mistake re enabled it, to discover that the feature is actually broken. So this plainly remove the code to support this feature, at the exception of the `fix_error_editor` hook. Indeed it is public API, so for now as it seem to be used only for this feature, we'll just raise a UserWarning (there is roughly 0 chance of this being tested as it's used mostly interactively, so DeprecationWarnings would be unseen). We'll remove later if no complaints Closes #9603

File last commit:

r20277:6ceb4492
r22576:b7d03ed6
Show More
check_sources.py
55 lines | 1.4 KiB | text/x-python | PythonLexer
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115 #!/usr/bin/env python
"""Utility to look for hard tabs and \r characters in all sources.
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116
Usage:
./check_sources.py
It prints summaries and if chosen, line-by-line info of where \\t or \\r
characters can be found in our source tree.
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115 """
Min RK
python3 syntax fixes on various scripts...
r20277 from __future__ import print_function
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 # Config
# If true, all lines that have tabs are printed, with line number
full_report_tabs = True
# If true, all lines that have tabs are printed, with line number
full_report_rets = False
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 # Code begins
from IPython.external.path import path
vivainio
merge all from 0.7.3 branch to trunk
r503
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115 rets = []
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 tabs = []
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 for f in path('..').walkfiles('*.py'):
vivainio
merge all from 0.7.3 branch to trunk
r503 errs = ''
cont = f.bytes()
if '\t' in cont:
errs+='t'
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 tabs.append(f)
vivainio
merge all from 0.7.3 branch to trunk
r503
if '\r' in cont:
errs+='r'
Fernando Perez
Tools cleanup in getting ready for 0.10.rc....
r2115 rets.append(f)
vivainio
merge all from 0.7.3 branch to trunk
r503
if errs:
Min RK
python3 syntax fixes on various scripts...
r20277 print("%3s" % errs, f)
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116
if 't' in errs and full_report_tabs:
for ln,line in enumerate(f.lines()):
if '\t' in line:
Min RK
python3 syntax fixes on various scripts...
r20277 print('TAB:',ln,':',line, end=' ')
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116
if 'r' in errs and full_report_rets:
for ln,line in enumerate(open(f.abspath(),'rb')):
if '\r' in line:
Min RK
python3 syntax fixes on various scripts...
r20277 print('RET:',ln,':',line, end=' ')
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116
# Summary at the end, to call cleanup tools if necessary
if tabs:
Min RK
python3 syntax fixes on various scripts...
r20277 print('Hard tabs found. These can be cleaned with untabify:')
for f in tabs: print(f, end=' ')
Fernando Perez
Cleanup check_sources and remove hard tabs from some files....
r2116 if rets:
Min RK
python3 syntax fixes on various scripts...
r20277 print('Carriage returns (\\r) found in:')
for f in rets: print(f, end=' ')