Permalink
Browse files

Remove unused _cleanup_ipy_script method.

  • Loading branch information...
1 parent fadef76 commit 1bd3d13d70e60bdf6323235a4e7f4e93ee2ffae7 @takluyver committed Apr 12, 2011
Showing with 0 additions and 28 deletions.
  1. +0 −28 IPython/core/interactiveshell.py
@@ -2354,34 +2354,6 @@ def _is_secondary_block_start(self, s):
s.startswith('finally')):
return True
- def _cleanup_ipy_script(self, script):
- """Make a script safe for self.runlines()
-
- Currently, IPython is lines based, with blocks being detected by
- empty lines. This is a problem for block based scripts that may
- not have empty lines after blocks. This script adds those empty
- lines to make scripts safe for running in the current line based
- IPython.
- """
- res = []
- lines = script.splitlines()
- level = 0
-
- for l in lines:
- lstripped = l.lstrip()
- stripped = l.strip()
- if not stripped:
- continue
- newlevel = len(l) - len(lstripped)
- if level > 0 and newlevel == 0 and \
- not self._is_secondary_block_start(stripped):
- # add empty line
- res.append('')
- res.append(l)
- level = newlevel
-
- return '\n'.join(res) + '\n'
-
#-------------------------------------------------------------------------
# Things related to GUI support and pylab
#-------------------------------------------------------------------------

0 comments on commit 1bd3d13

Please sign in to comment.