From 7230118af8df027fb559c38a6598571c2de44de8 2013-01-31 13:41:59 From: Thomas Kluyver Date: 2013-01-31 13:41:59 Subject: [PATCH] Remove unused code --- diff --git a/IPython/frontend/terminal/ipapp.py b/IPython/frontend/terminal/ipapp.py index b2f540a..829b3fc 100755 --- a/IPython/frontend/terminal/ipapp.py +++ b/IPython/frontend/terminal/ipapp.py @@ -48,7 +48,6 @@ from IPython.core.shellapp import ( InteractiveShellApp, shell_flags, shell_aliases ) from IPython.frontend.terminal.interactiveshell import TerminalInteractiveShell -from IPython.lib import inputhook from IPython.utils import warn from IPython.utils.path import get_ipython_dir, check_for_old_config from IPython.utils.traitlets import ( diff --git a/IPython/utils/text.py b/IPython/utils/text.py index 736c524..35ca6bc 100644 --- a/IPython/utils/text.py +++ b/IPython/utils/text.py @@ -23,7 +23,6 @@ import __main__ import os import re -import shutil import sys import textwrap from string import Formatter @@ -403,31 +402,6 @@ def indent(instr,nspaces=4, ntabs=0, flatten=False): else: return outstr -def native_line_ends(filename,backup=1): - """Convert (in-place) a file to line-ends native to the current OS. - - If the optional backup argument is given as false, no backup of the - original file is left. """ - - backup_suffixes = {'posix':'~','dos':'.bak','nt':'.bak','mac':'.bak'} - - bak_filename = filename + backup_suffixes[os.name] - - original = open(filename).read() - shutil.copy2(filename,bak_filename) - try: - new = open(filename,'wb') - new.write(os.linesep.join(original.splitlines())) - new.write(os.linesep) # ALWAYS put an eol at the end of the file - new.close() - except: - os.rename(bak_filename,filename) - if not backup: - try: - os.remove(bak_filename) - except: - pass - def list_strings(arg): """Always return a list of strings, given a string or list of strings