From cfd696fcbf5aac20701293ef484e92d03a0ae7fb 2013-03-31 09:03:54 From: Thomas Kluyver Date: 2013-03-31 09:03:54 Subject: [PATCH] More whitespace between top level functions --- diff --git a/IPython/core/inputtransformer.py b/IPython/core/inputtransformer.py index 314deb4..e083e3a 100644 --- a/IPython/core/inputtransformer.py +++ b/IPython/core/inputtransformer.py @@ -30,7 +30,6 @@ ESC_SEQUENCES = [ESC_SHELL, ESC_SH_CAP, ESC_HELP ,\ ESC_QUOTE, ESC_QUOTE2, ESC_PAREN ] - class InputTransformer(object): __metaclass__ = abc.ABCMeta @@ -193,6 +192,7 @@ def has_comment(src): pass return(tokenize.COMMENT in toktypes) + @stateless_input_transformer def help_end(line): """Translate lines with ?/?? at the end""" @@ -207,8 +207,8 @@ def help_end(line): next_input = line.rstrip('?') if line.strip() != m.group(0) else None return _make_help_call(target, esc, lspace, next_input) - - + + @coroutine_input_transformer def cellmagic(): tpl = 'get_ipython().run_cell_magic(%r, %r, %r)' @@ -235,6 +235,7 @@ def cellmagic(): magic_name = magic_name.lstrip(ESC_MAGIC2) line = tpl % (magic_name, first, u'\n'.join(body)) + def _strip_prompts(prompt1_re, prompt2_re): """Remove matching input prompts from a block of input.""" line = '' @@ -272,6 +273,7 @@ def ipy_prompt(): ipy_prompt.look_in_string = True + @coroutine_input_transformer def leading_indent(): space_re = re.compile(r'^[ \t]+') @@ -296,6 +298,7 @@ def leading_indent(): leading_indent.look_in_string = True + def _special_assignment(assignment_re, template): line = '' while True: