##// END OF EJS Templates
fix handling of aliases/system calls for multiline input
fperez -
Show More
@@ -1,7 +1,7 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Release data for the IPython project.
2 """Release data for the IPython project.
3
3
4 $Id: Release.py 981 2005-12-30 15:43:43Z fperez $"""
4 $Id: Release.py 982 2005-12-30 23:57:07Z fperez $"""
5
5
6 #*****************************************************************************
6 #*****************************************************************************
7 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
7 # Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
@@ -22,9 +22,9 b" name = 'ipython'"
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
22 # because bdist_rpm does not accept dashes (an RPM) convention, and
23 # bdist_deb does not accept underscores (a Debian convention).
23 # bdist_deb does not accept underscores (a Debian convention).
24
24
25 version = '0.7.0.rc2'
25 version = '0.7.0.rc3'
26
26
27 revision = '$Revision: 981 $'
27 revision = '$Revision: 982 $'
28
28
29 description = "An enhanced interactive Python shell."
29 description = "An enhanced interactive Python shell."
30
30
@@ -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 978 2005-12-30 02:37:15Z fperez $
9 $Id: iplib.py 982 2005-12-30 23:57:07Z fperez $
10 """
10 """
11
11
12 #*****************************************************************************
12 #*****************************************************************************
@@ -1598,6 +1598,8 b' want to merge them back into the new files.""" % locals()'
1598 # interactive loop, since that one is only seen by keyboard input. We
1598 # interactive loop, since that one is only seen by keyboard input. We
1599 # need this done correctly even for code run via runlines (which uses
1599 # need this done correctly even for code run via runlines (which uses
1600 # push).
1600 # push).
1601
1602 print 'push line: <%s>' % line # dbg
1601 self.autoindent_update(line)
1603 self.autoindent_update(line)
1602
1604
1603 self.buffer.append(line)
1605 self.buffer.append(line)
@@ -1812,7 +1814,9 b' want to merge them back into the new files.""" % locals()'
1812 pre=None,iFun=None,theRest=None):
1814 pre=None,iFun=None,theRest=None):
1813 """Handle alias input lines. """
1815 """Handle alias input lines. """
1814
1816
1815 line_out = 'ipalias("%s %s")' % (iFun,esc_quotes(theRest))
1817 # pre is needed, because it carries the leading whitespace. Otherwise
1818 # aliases won't work in indented sections.
1819 line_out = '%sipalias("%s %s")' % (pre,iFun,esc_quotes(theRest))
1816 self.log(line_out,continue_prompt)
1820 self.log(line_out,continue_prompt)
1817 return line_out
1821 return line_out
1818
1822
@@ -1828,7 +1832,7 b' want to merge them back into the new files.""" % locals()'
1828 return pre
1832 return pre
1829 else:
1833 else:
1830 cmd = ("%s %s" % (iFun[1:],theRest))
1834 cmd = ("%s %s" % (iFun[1:],theRest))
1831 line_out = 'ipsystem(r"""%s"""[:-1])' % (cmd + "_")
1835 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd + "_")
1832 else: # single-line input
1836 else: # single-line input
1833 if line.startswith('!!'):
1837 if line.startswith('!!'):
1834 # rewrite iFun/theRest to properly hold the call to %sx and
1838 # rewrite iFun/theRest to properly hold the call to %sx and
@@ -1840,7 +1844,7 b' want to merge them back into the new files.""" % locals()'
1840 continue_prompt,pre,iFun,theRest)
1844 continue_prompt,pre,iFun,theRest)
1841 else:
1845 else:
1842 cmd=line[1:]
1846 cmd=line[1:]
1843 line_out = 'ipsystem(r"""%s"""[:-1])' % (cmd +"_")
1847 line_out = '%sipsystem(r"""%s"""[:-1])' % (pre,cmd +"_")
1844 # update cache/log and return
1848 # update cache/log and return
1845 self.log(line_out,continue_prompt)
1849 self.log(line_out,continue_prompt)
1846 return line_out
1850 return line_out
@@ -1,5 +1,9 b''
1 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
1 2005-12-30 Fernando Perez <Fernando.Perez@colorado.edu>
2
2
3 * IPython/iplib.py (handle_shell_escape): fix bug where both
4 aliases and system accesses where broken for indented code (such
5 as loops).
6
3 * IPython/genutils.py (shell): fix small but critical bug for
7 * IPython/genutils.py (shell): fix small but critical bug for
4 win32 system access.
8 win32 system access.
5
9
@@ -106,6 +106,19 b' Things that should be done for the current series, before starting major'
106 Fix any bugs reported at the online bug tracker.
106 Fix any bugs reported at the online bug tracker.
107 \layout Itemize
107 \layout Itemize
108
108
109 History bug: I often see that, under certain circumstances, the input history
110 is incorrect.
111 The problem is that so far, I've failed to find a simple way to reproduce
112 it consistently, so I can't easily track it down.
113 It seems to me that it happens when output is generated multiple times
114 for the same input (for i in range(10): i will do it).
115 But even this isn't reliable...
116 Ultimately the right solution for this is to cleanly separate the dataflow
117 for input/output history management; right now that happens all over the
118 place, which makes the code impossible to debug, and almost guaranteed
119 to be buggy in the first place.
120 \layout Itemize
121
109
122
110 \series bold
123 \series bold
111 Redesign the output traps.
124 Redesign the output traps.
General Comments 0
You need to be logged in to leave comments. Login now