<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Module: core.prefilter — IPython 2.3.0 documentation</title> <link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '2.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" /> <link rel="up" title="The IPython API" href="../index.html" /> <link rel="next" title="Module: core.profileapp" href="IPython.core.profileapp.html" /> <link rel="prev" title="Module: core.payloadpage" href="IPython.core.payloadpage.html" /> </head> <body> <div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px"> <a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="IPython.core.profileapp.html" title="Module: core.profileapp" accesskey="N">next</a> |</li> <li class="right" > <a href="IPython.core.payloadpage.html" title="Module: core.payloadpage" accesskey="P">previous</a> |</li> <li><a href="http://ipython.org">home</a>| </li> <li><a href="../../search.html">search</a>| </li> <li><a href="../../index.html">documentation </a> »</li> <li><a href="../index.html" accesskey="U">The IPython API</a> »</li> </ul> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">core.prefilter</span></tt></a><ul> <li><a class="reference internal" href="#classes">16 Classes</a></li> <li><a class="reference internal" href="#function">1 Function</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="IPython.core.payloadpage.html" title="previous chapter">Module: <tt class="docutils literal"><span class="pre">core.payloadpage</span></tt></a></p> <h4>Next topic</h4> <p class="topless"><a href="IPython.core.profileapp.html" title="next chapter">Module: <tt class="docutils literal"><span class="pre">core.profileapp</span></tt></a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/api/generated/IPython.core.prefilter.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-IPython.core.prefilter"> <span id="module-core-prefilter"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">core.prefilter</span></tt><a class="headerlink" href="#module-IPython.core.prefilter" title="Permalink to this headline">¶</a></h1> <p>Prefiltering components.</p> <p>Prefilters transform user input before it is exec’d by Python. These transforms are used to implement additional syntax such as !ls and %magic.</p> <p>Authors:</p> <ul class="simple"> <li>Brian Granger</li> <li>Fernando Perez</li> <li>Dan Milstein</li> <li>Ville Vainio</li> </ul> <div class="section" id="classes"> <h2>16 Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="IPython.core.prefilter.PrefilterError"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PrefilterError</tt><a class="headerlink" href="#IPython.core.prefilter.PrefilterError" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference external" href="http://docs.python.org/2/library/exceptions.html#exceptions.Exception" title="(in Python v2.7)"><tt class="xref py py-class docutils literal"><span class="pre">exceptions.Exception</span></tt></a></p> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.PrefilterManager"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PrefilterManager</tt><big>(</big><em>shell=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="IPython.config.configurable.html#IPython.config.configurable.Configurable" title="IPython.config.configurable.Configurable"><tt class="xref py py-class docutils literal"><span class="pre">IPython.config.configurable.Configurable</span></tt></a></p> <p>Main prefilter component.</p> <p>The IPython prefilter is run on all user input before it is run. The prefilter consumes lines of input and produces transformed lines of input.</p> <p>The iplementation consists of two phases:</p> <ol class="arabic simple"> <li>Transformers</li> <li>Checkers and handlers</li> </ol> <p>Over time, we plan on deprecating the checkers and handlers and doing everything in the transformers.</p> <p>The transformers are instances of <a class="reference internal" href="#IPython.core.prefilter.PrefilterTransformer" title="IPython.core.prefilter.PrefilterTransformer"><tt class="xref py py-class docutils literal"><span class="pre">PrefilterTransformer</span></tt></a> and have a single method <tt class="xref py py-meth docutils literal"><span class="pre">transform()</span></tt> that takes a line and returns a transformed line. The transformation can be accomplished using any tool, but our current ones use regular expressions for speed.</p> <p>After all the transformers have been run, the line is fed to the checkers, which are instances of <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">PrefilterChecker</span></tt></a>. The line is passed to the <tt class="xref py py-meth docutils literal"><span class="pre">check()</span></tt> method, which either returns <cite>None</cite> or a <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">PrefilterHandler</span></tt></a> instance. If <cite>None</cite> is returned, the other checkers are tried. If an <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">PrefilterHandler</span></tt></a> instance is returned, the line is passed to the <tt class="xref py py-meth docutils literal"><span class="pre">handle()</span></tt> method of the returned handler and no further checkers are tried.</p> <p>Both transformers and checkers have a <cite>priority</cite> attribute, that determines the order in which they are called. Smaller priorities are tried first.</p> <p>Both transformers and checkers also have <cite>enabled</cite> attribute, which is a boolean that determines if the instance is used.</p> <p>Users or developers can change the priority or enabled attribute of transformers or checkers, but they must call the <a class="reference internal" href="#IPython.core.prefilter.PrefilterManager.sort_checkers" title="IPython.core.prefilter.PrefilterManager.sort_checkers"><tt class="xref py py-meth docutils literal"><span class="pre">sort_checkers()</span></tt></a> or <a class="reference internal" href="#IPython.core.prefilter.PrefilterManager.sort_transformers" title="IPython.core.prefilter.PrefilterManager.sort_transformers"><tt class="xref py py-meth docutils literal"><span class="pre">sort_transformers()</span></tt></a> method after changing the priority.</p> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.__init__"> <tt class="descname">__init__</tt><big>(</big><em>shell=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.__init__" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="attribute"> <dt id="IPython.core.prefilter.PrefilterManager.checkers"> <tt class="descname">checkers</tt><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.checkers" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of checkers, sorted by priority.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.find_handler"> <tt class="descname">find_handler</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.find_handler" title="Permalink to this definition">¶</a></dt> <dd><p>Find a handler for the line_info by trying checkers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.get_handler_by_esc"> <tt class="descname">get_handler_by_esc</tt><big>(</big><em>esc_str</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.get_handler_by_esc" title="Permalink to this definition">¶</a></dt> <dd><p>Get a handler by its escape string.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.get_handler_by_name"> <tt class="descname">get_handler_by_name</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.get_handler_by_name" title="Permalink to this definition">¶</a></dt> <dd><p>Get a handler by its name.</p> </dd></dl> <dl class="attribute"> <dt id="IPython.core.prefilter.PrefilterManager.handlers"> <tt class="descname">handlers</tt><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.handlers" title="Permalink to this definition">¶</a></dt> <dd><p>Return a dict of all the handlers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.init_checkers"> <tt class="descname">init_checkers</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.init_checkers" title="Permalink to this definition">¶</a></dt> <dd><p>Create the default checkers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.init_handlers"> <tt class="descname">init_handlers</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.init_handlers" title="Permalink to this definition">¶</a></dt> <dd><p>Create the default handlers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.init_transformers"> <tt class="descname">init_transformers</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.init_transformers" title="Permalink to this definition">¶</a></dt> <dd><p>Create the default transformers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.prefilter_line"> <tt class="descname">prefilter_line</tt><big>(</big><em>line</em>, <em>continue_prompt=False</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.prefilter_line" title="Permalink to this definition">¶</a></dt> <dd><p>Prefilter a single input line as text.</p> <p>This method prefilters a single line of text by calling the transformers and then the checkers/handlers.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.prefilter_line_info"> <tt class="descname">prefilter_line_info</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.prefilter_line_info" title="Permalink to this definition">¶</a></dt> <dd><p>Prefilter a line that has been converted to a LineInfo object.</p> <p>This implements the checker/handler part of the prefilter pipe.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.prefilter_lines"> <tt class="descname">prefilter_lines</tt><big>(</big><em>lines</em>, <em>continue_prompt=False</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.prefilter_lines" title="Permalink to this definition">¶</a></dt> <dd><p>Prefilter multiple input lines of text.</p> <p>This is the main entry point for prefiltering multiple lines of input. This simply calls <a class="reference internal" href="#IPython.core.prefilter.PrefilterManager.prefilter_line" title="IPython.core.prefilter.PrefilterManager.prefilter_line"><tt class="xref py py-meth docutils literal"><span class="pre">prefilter_line()</span></tt></a> for each line of input.</p> <p>This covers cases where there are multiple lines in the user entry, which is the case when the user goes back to a multiline history entry and presses enter.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.register_checker"> <tt class="descname">register_checker</tt><big>(</big><em>checker</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.register_checker" title="Permalink to this definition">¶</a></dt> <dd><p>Register a checker instance.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.register_handler"> <tt class="descname">register_handler</tt><big>(</big><em>name</em>, <em>handler</em>, <em>esc_strings</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.register_handler" title="Permalink to this definition">¶</a></dt> <dd><p>Register a handler instance by name with esc_strings.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.register_transformer"> <tt class="descname">register_transformer</tt><big>(</big><em>transformer</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.register_transformer" title="Permalink to this definition">¶</a></dt> <dd><p>Register a transformer instance.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.sort_checkers"> <tt class="descname">sort_checkers</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.sort_checkers" title="Permalink to this definition">¶</a></dt> <dd><p>Sort the checkers by priority.</p> <p>This must be called after the priority of a checker is changed. The <a class="reference internal" href="#IPython.core.prefilter.PrefilterManager.register_checker" title="IPython.core.prefilter.PrefilterManager.register_checker"><tt class="xref py py-meth docutils literal"><span class="pre">register_checker()</span></tt></a> method calls this automatically.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.sort_transformers"> <tt class="descname">sort_transformers</tt><big>(</big><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.sort_transformers" title="Permalink to this definition">¶</a></dt> <dd><p>Sort the transformers by priority.</p> <p>This must be called after the priority of a transformer is changed. The <a class="reference internal" href="#IPython.core.prefilter.PrefilterManager.register_transformer" title="IPython.core.prefilter.PrefilterManager.register_transformer"><tt class="xref py py-meth docutils literal"><span class="pre">register_transformer()</span></tt></a> method calls this automatically.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.transform_line"> <tt class="descname">transform_line</tt><big>(</big><em>line</em>, <em>continue_prompt</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.transform_line" title="Permalink to this definition">¶</a></dt> <dd><p>Calls the enabled transformers in order of increasing priority.</p> </dd></dl> <dl class="attribute"> <dt id="IPython.core.prefilter.PrefilterManager.transformers"> <tt class="descname">transformers</tt><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.transformers" title="Permalink to this definition">¶</a></dt> <dd><p>Return a list of checkers, sorted by priority.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.unregister_checker"> <tt class="descname">unregister_checker</tt><big>(</big><em>checker</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.unregister_checker" title="Permalink to this definition">¶</a></dt> <dd><p>Unregister a checker instance.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.unregister_handler"> <tt class="descname">unregister_handler</tt><big>(</big><em>name</em>, <em>handler</em>, <em>esc_strings</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.unregister_handler" title="Permalink to this definition">¶</a></dt> <dd><p>Unregister a handler instance by name with esc_strings.</p> </dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterManager.unregister_transformer"> <tt class="descname">unregister_transformer</tt><big>(</big><em>transformer</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterManager.unregister_transformer" title="Permalink to this definition">¶</a></dt> <dd><p>Unregister a transformer instance.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.PrefilterTransformer"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PrefilterTransformer</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterTransformer" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="IPython.config.configurable.html#IPython.config.configurable.Configurable" title="IPython.config.configurable.Configurable"><tt class="xref py py-class docutils literal"><span class="pre">IPython.config.configurable.Configurable</span></tt></a></p> <p>Transform a line of user input.</p> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterTransformer.__init__"> <tt class="descname">__init__</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterTransformer.__init__" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterTransformer.transform"> <tt class="descname">transform</tt><big>(</big><em>line</em>, <em>continue_prompt</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterTransformer.transform" title="Permalink to this definition">¶</a></dt> <dd><p>Transform a line, returning the new one.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.PrefilterChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PrefilterChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="IPython.config.configurable.html#IPython.config.configurable.Configurable" title="IPython.config.configurable.Configurable"><tt class="xref py py-class docutils literal"><span class="pre">IPython.config.configurable.Configurable</span></tt></a></p> <p>Inspect an input line and return a handler for that line.</p> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterChecker.__init__"> <tt class="descname">__init__</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterChecker.__init__" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>Inspect line_info and return a handler instance or None.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.EmacsChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">EmacsChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.EmacsChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.EmacsChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.EmacsChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>Emacs ipython-mode tags certain input lines.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.MacroChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">MacroChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.MacroChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.IPyAutocallChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">IPyAutocallChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.IPyAutocallChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.IPyAutocallChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.IPyAutocallChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>Instances of IPyAutocall in user_ns get autocalled immediately</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.AssignmentChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">AssignmentChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AssignmentChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.AssignmentChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AssignmentChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>Check to see if user is assigning to a var for the first time, in which case we want to avoid any sort of automagic / autocall games.</p> <p>This allows users to assign to either alias or magic names true python variables (the magic/alias systems always take second seat to true python code). E.g. ls=’hi’, or ls,that=1,2</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.AutoMagicChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">AutoMagicChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutoMagicChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.AutoMagicChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutoMagicChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>If the ifun is magic, and automagic is on, run it. Note: normal, non-auto magic would already have been triggered via ‘%’ in check_esc_chars. This just checks for automagic. Also, before triggering the magic handler, make sure that there is nothing in the user namespace which could shadow it.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.PythonOpsChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PythonOpsChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PythonOpsChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.PythonOpsChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PythonOpsChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>If the ‘rest’ of the line begins with a function call or pretty much any python operator, we should simply execute the line (regardless of whether or not there’s a possible autocall expansion). This avoids spurious (and very confusing) geattr() accesses.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.AutocallChecker"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">AutocallChecker</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutocallChecker" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterChecker" title="IPython.core.prefilter.PrefilterChecker"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterChecker</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.AutocallChecker.check"> <tt class="descname">check</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutocallChecker.check" title="Permalink to this definition">¶</a></dt> <dd><p>Check if the initial word/function is callable and autocall is on.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.PrefilterHandler"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">PrefilterHandler</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="IPython.config.configurable.html#IPython.config.configurable.Configurable" title="IPython.config.configurable.Configurable"><tt class="xref py py-class docutils literal"><span class="pre">IPython.config.configurable.Configurable</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterHandler.__init__"> <tt class="descname">__init__</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterHandler.__init__" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <dl class="method"> <dt id="IPython.core.prefilter.PrefilterHandler.handle"> <tt class="descname">handle</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.PrefilterHandler.handle" title="Permalink to this definition">¶</a></dt> <dd><p>Handle normal input lines. Use as a template for handlers.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.MacroHandler"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">MacroHandler</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.MacroHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterHandler</span></tt></a></p> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.MagicHandler"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">MagicHandler</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.MagicHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterHandler</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.MagicHandler.handle"> <tt class="descname">handle</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.MagicHandler.handle" title="Permalink to this definition">¶</a></dt> <dd><p>Execute magic functions.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.AutoHandler"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">AutoHandler</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutoHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterHandler</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.AutoHandler.handle"> <tt class="descname">handle</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.AutoHandler.handle" title="Permalink to this definition">¶</a></dt> <dd><p>Handle lines which can be auto-executed, quoting if requested.</p> </dd></dl> </dd></dl> <dl class="class"> <dt id="IPython.core.prefilter.EmacsHandler"> <em class="property">class </em><tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">EmacsHandler</tt><big>(</big><em>shell=None</em>, <em>prefilter_manager=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.EmacsHandler" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <a class="reference internal" href="#IPython.core.prefilter.PrefilterHandler" title="IPython.core.prefilter.PrefilterHandler"><tt class="xref py py-class docutils literal"><span class="pre">IPython.core.prefilter.PrefilterHandler</span></tt></a></p> <dl class="method"> <dt id="IPython.core.prefilter.EmacsHandler.handle"> <tt class="descname">handle</tt><big>(</big><em>line_info</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.EmacsHandler.handle" title="Permalink to this definition">¶</a></dt> <dd><p>Handle input lines marked by python-mode.</p> </dd></dl> </dd></dl> </div> <div class="section" id="function"> <h2>1 Function<a class="headerlink" href="#function" title="Permalink to this headline">¶</a></h2> <dl class="function"> <dt id="IPython.core.prefilter.is_shadowed"> <tt class="descclassname">IPython.core.prefilter.</tt><tt class="descname">is_shadowed</tt><big>(</big><em>identifier</em>, <em>ip</em><big>)</big><a class="headerlink" href="#IPython.core.prefilter.is_shadowed" title="Permalink to this definition">¶</a></dt> <dd><p>Is the given identifier defined in one of the namespaces which shadow the alias and magic namespaces? Note that an identifier is different than ifun, because it can not contain a ‘.’ character.</p> </dd></dl> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="IPython.core.profileapp.html" title="Module: core.profileapp" >next</a> |</li> <li class="right" > <a href="IPython.core.payloadpage.html" title="Module: core.payloadpage" >previous</a> |</li> <li><a href="http://ipython.org">home</a>| </li> <li><a href="../../search.html">search</a>| </li> <li><a href="../../index.html">documentation </a> »</li> <li><a href="../index.html" >The IPython API</a> »</li> </ul> </div> <div class="footer"> © Copyright The IPython Development Team. Last updated on Sep 02, 2015. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. </div> </body> </html>