diff --git a/IPython/iplib.py b/IPython/iplib.py index 196c869..b21a1d6 100644 --- a/IPython/iplib.py +++ b/IPython/iplib.py @@ -6,7 +6,7 @@ Requires Python 2.1 or newer. This file contains all the classes and helper functions specific to IPython. -$Id: iplib.py 1007 2006-01-12 17:15:41Z vivainio $ +$Id: iplib.py 1012 2006-01-12 21:29:37Z vivainio $ """ #***************************************************************************** @@ -1898,7 +1898,7 @@ want to merge them back into the new files.""" % locals() #print 'line in :', `line` # dbg # Example of a special handler. Others follow a similar pattern. - if line.startswith('!!'): + if line.lstrip().startswith('!!'): # rewrite iFun/theRest to properly hold the call to %sx and # the actual command to be executed, so handle_magic can work # correctly @@ -1907,7 +1907,7 @@ want to merge them back into the new files.""" % locals() return self.handle_magic('%ssx %s' % (self.ESC_MAGIC,line[2:]), continue_prompt,pre,iFun,theRest) else: - cmd=line[1:] + cmd=line.lstrip()[1:] line_out = '%sipsystem(%s)' % (pre,make_quoted_expr(cmd)) # update cache/log and return self.log(line_out,continue_prompt) diff --git a/doc/ChangeLog b/doc/ChangeLog index 4a4838f..2610108 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,23 +1,30 @@ 2006-01-12 Ville Vainio - * IPython/iplib.py.py (make_quoted_expr,handle_shell_escape): + * IPython/iplib.py (make_quoted_expr,handle_shell_escape): Prettified and hardened string/backslash quoting with ipsystem(), ipalias() and ipmagic(). Now even \ characters are passed to %magics, !shell escapes and aliases exactly as they are in the ipython command line. Should improve backslash experience, - particularly in Windows. %cd magic still doesn't support backslash - path delimiters, though. Also deleted all pretense of supporting - multiline command strings in !system or %magic commands. Thanks to - Jerry McRae for suggestions. + particularly in Windows (path delimiter for some commands that + won't understand '/'), but Unix benefits as well (regexps). %cd + magic still doesn't support backslash path delimiters, though. Also + deleted all pretense of supporting multiline command strings in + !system or %magic commands. Thanks to Jerry McRae for suggestions. * doc/build_doc_instructions.txt added. Documentation on how to use doc/update_manual.py, added yesterday. Both files contributed by Jörgen Stenarson . This slates doc/*.sh for deprecation at a later date. - * Added ipython.py to root directory for zero-installation - (tar xzvf ipython.tgz; cd ipython; python ipython.py) and - development convenience. + * /ipython.py Added ipython.py to root directory for + zero-installation (tar xzvf ipython.tgz; cd ipython; python + ipython.py) and development convenience (no need to kee doing + "setup.py install" between changes). + + * Made ! and !! shell escapes work (again) in multiline expressions: + if 1: + !ls + !!ls 2006-01-12 Fernando Perez