##// END OF EJS Templates
Fix extra newlines in autocalling.
fperez -
Show More
@@ -6,7 +6,7 b' Requires Python 2.1 or newer.'
6
6
7 This file contains all the classes and helper functions specific to IPython.
7 This file contains all the classes and helper functions specific to IPython.
8
8
9 $Id: iplib.py 802 2005-09-06 03:49:12Z fperez $
9 $Id: iplib.py 807 2005-09-07 01:55:33Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -1864,10 +1864,10 b' want to merge them back into the new files.""" % locals()'
1864
1864
1865 if pre == self.ESC_QUOTE:
1865 if pre == self.ESC_QUOTE:
1866 # Auto-quote splitting on whitespace
1866 # Auto-quote splitting on whitespace
1867 newcmd = '%s("%s")\n' % (iFun,'", "'.join(theRest.split()) )
1867 newcmd = '%s("%s")' % (iFun,'", "'.join(theRest.split()) )
1868 elif pre == self.ESC_QUOTE2:
1868 elif pre == self.ESC_QUOTE2:
1869 # Auto-quote whole string
1869 # Auto-quote whole string
1870 newcmd = '%s("%s")\n' % (iFun,theRest)
1870 newcmd = '%s("%s")' % (iFun,theRest)
1871 else:
1871 else:
1872 # Auto-paren
1872 # Auto-paren
1873 if theRest[0:1] in ('=','['):
1873 if theRest[0:1] in ('=','['):
@@ -1875,16 +1875,16 b' want to merge them back into the new files.""" % locals()'
1875 # rebindings of an existing callable's name, or item access
1875 # rebindings of an existing callable's name, or item access
1876 # for an object which is BOTH callable and implements
1876 # for an object which is BOTH callable and implements
1877 # __getitem__.
1877 # __getitem__.
1878 return '%s %s\n' % (iFun,theRest)
1878 return '%s %s' % (iFun,theRest)
1879 if theRest.endswith(';'):
1879 if theRest.endswith(';'):
1880 newcmd = '%s(%s);\n' % (iFun.rstrip(),theRest[:-1])
1880 newcmd = '%s(%s);' % (iFun.rstrip(),theRest[:-1])
1881 else:
1881 else:
1882 newcmd = '%s(%s)\n' % (iFun.rstrip(),theRest)
1882 newcmd = '%s(%s)' % (iFun.rstrip(),theRest)
1883
1883
1884 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd,
1884 print >>Term.cout, self.outputcache.prompt1.auto_rewrite() + newcmd
1885 # log what is now valid Python, not the actual user input (without the
1885 # log what is now valid Python, not the actual user input (without the
1886 # final newline)
1886 # final newline)
1887 self.log(newcmd.strip(),continue_prompt)
1887 self.log(newcmd,continue_prompt)
1888 return newcmd
1888 return newcmd
1889
1889
1890 def handle_help(self, line, continue_prompt=None,
1890 def handle_help(self, line, continue_prompt=None,
@@ -1,3 +1,9 b''
1 2005-09-06 Fernando Perez <Fernando.Perez@colorado.edu>
2
3 * IPython/iplib.py (handle_auto): Fix inconsistency arising from
4 spurious newlines added by this routine. After a report by
5 F. Mantegazza.
6
1 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
7 2005-09-05 Fernando Perez <Fernando.Perez@colorado.edu>
2
8
3 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
9 * IPython/Shell.py (hijack_gtk): remove pygtk.require("2.0")
General Comments 0
You need to be logged in to leave comments. Login now