##// END OF EJS Templates
Merge pull request #1361 from ellisonbg/nbissues...
Merge pull request #1361 from ellisonbg/nbissues A number of bug fixes for notebook issues that had crept up recently with all the major improvements done on multiple fronts. In closing #1359, we've changed slightly how Math() works: it now unconditionally surrounds its input with $$...$$, so that it always appears in displayed math mode. We have also introduced a new display object, Latex(), which does *not* add any latex markup, for other constructs beyond simple math expressions. This change makes Math() friendlier to use in simple cases and means that Math(sympy.latex(foo)) will produce the expected displayed math results without the user having to add any $ markup. Summary of fixes: Fixes #1344: Ctrl + M + L does not toggle line numbering in htmlnotebook. Fixes #1337: Tab in the notebook after `(` should not indent, only give a tooltip. Fixes #1339: Notebook printing broken. Fixes #1348: `Ctrl-m-Ctrl-m` does not switch to markdown cell Fixes #1359: [sympyprinting] MathJax can't render \root{m}{n}

File last commit:

r2116:87ec1117
r6066:54c3e061 merge
Show More
check_sources.py
54 lines | 1.3 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 """
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:
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:
print 'TAB:',ln,':',line,
if 'r' in errs and full_report_rets:
for ln,line in enumerate(open(f.abspath(),'rb')):
if '\r' in line:
print 'RET:',ln,':',line,
# Summary at the end, to call cleanup tools if necessary
if tabs:
print 'Hard tabs found. These can be cleaned with untabify:'
for f in tabs: print f,
if rets:
print 'Carriage returns (\\r) found in:'
for f in rets: print f,