
<!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" lang="ru">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>m_librarian.web.views.layout &#8212; Документация m_Librarian 0.1.2</title>
    <link rel="stylesheet" href="../../../../_static/nature.css" type="text/css" />
    <link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript" src="../../../../_static/documentation_options.js"></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>
    <script type="text/javascript" src="../../../../_static/translations.js"></script>
    <link rel="index" title="Алфавитный указатель" href="../../../../genindex.html" />
    <link rel="search" title="Поиск" href="../../../../search.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Навигация</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="Алфавитный указатель"
             accesskey="I">указатель</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Содержание модулей Python"
             >модули</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">Документация m_Librarian 0.1.2</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Код модуля</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <h1>Исходный код m_librarian.web.views.layout</h1><div class="highlight"><pre>
<span></span><span class="ch">#!/usr/bin/env python</span>
<span class="c1"># -*- coding: utf-8 -*-</span>




<span class="c1">##################################################</span>
<span class="c1">## DEPENDENCIES</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">os.path</span>
<span class="k">try</span><span class="p">:</span>
    <span class="kn">import</span> <span class="nn">builtins</span> <span class="k">as</span> <span class="nn">builtin</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
    <span class="kn">import</span> <span class="nn">__builtin__</span> <span class="k">as</span> <span class="nn">builtin</span>
<span class="kn">from</span> <span class="nn">os.path</span> <span class="k">import</span> <span class="n">getmtime</span><span class="p">,</span> <span class="n">exists</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">import</span> <span class="nn">types</span>
<span class="kn">from</span> <span class="nn">Cheetah.Version</span> <span class="k">import</span> <span class="n">MinCompatibleVersion</span> <span class="k">as</span> <span class="n">RequiredCheetahVersion</span>
<span class="kn">from</span> <span class="nn">Cheetah.Version</span> <span class="k">import</span> <span class="n">MinCompatibleVersionTuple</span> <span class="k">as</span> <span class="n">RequiredCheetahVersionTuple</span>
<span class="kn">from</span> <span class="nn">Cheetah.Template</span> <span class="k">import</span> <span class="n">Template</span>
<span class="kn">from</span> <span class="nn">Cheetah.DummyTransaction</span> <span class="k">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">Cheetah.NameMapper</span> <span class="k">import</span> <span class="n">NotFound</span><span class="p">,</span> <span class="n">valueForName</span><span class="p">,</span> <span class="n">valueFromSearchList</span><span class="p">,</span> <span class="n">valueFromFrameOrSearchList</span>
<span class="kn">from</span> <span class="nn">Cheetah.CacheRegion</span> <span class="k">import</span> <span class="n">CacheRegion</span>
<span class="kn">import</span> <span class="nn">Cheetah.Filters</span> <span class="k">as</span> <span class="nn">Filters</span>
<span class="kn">import</span> <span class="nn">Cheetah.ErrorCatchers</span> <span class="k">as</span> <span class="nn">ErrorCatchers</span>
<span class="kn">from</span> <span class="nn">Cheetah.compat</span> <span class="k">import</span> <span class="n">unicode</span>

<span class="c1">##################################################</span>
<span class="c1">## MODULE CONSTANTS</span>
<span class="n">VFFSL</span><span class="o">=</span><span class="n">valueFromFrameOrSearchList</span>
<span class="n">VFSL</span><span class="o">=</span><span class="n">valueFromSearchList</span>
<span class="n">VFN</span><span class="o">=</span><span class="n">valueForName</span>
<span class="n">currentTime</span><span class="o">=</span><span class="n">time</span><span class="o">.</span><span class="n">time</span>
<span class="n">__CHEETAH_version__</span> <span class="o">=</span> <span class="s1">&#39;3.1.0&#39;</span>
<span class="n">__CHEETAH_versionTuple__</span> <span class="o">=</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;final&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">__CHEETAH_genTime__</span> <span class="o">=</span> <span class="mf">1523141278.03866</span>
<span class="n">__CHEETAH_genTimestamp__</span> <span class="o">=</span> <span class="s1">&#39;Sun Apr  8 01:47:58 2018&#39;</span>
<span class="n">__CHEETAH_src__</span> <span class="o">=</span> <span class="s1">&#39;layout.tmpl&#39;</span>
<span class="n">__CHEETAH_srcLastModified__</span> <span class="o">=</span> <span class="s1">&#39;Sun Apr  8 01:47:39 2018&#39;</span>
<span class="n">__CHEETAH_docstring__</span> <span class="o">=</span> <span class="s1">&#39;Autogenerated by Cheetah: The Python-Powered Template Engine&#39;</span>

<span class="k">if</span> <span class="n">__CHEETAH_versionTuple__</span> <span class="o">&lt;</span> <span class="n">RequiredCheetahVersionTuple</span><span class="p">:</span>
    <span class="k">raise</span> <span class="ne">AssertionError</span><span class="p">(</span>
      <span class="s1">&#39;This template was compiled with Cheetah version&#39;</span>
      <span class="s1">&#39; </span><span class="si">%s</span><span class="s1">. Templates compiled before version </span><span class="si">%s</span><span class="s1"> must be recompiled.&#39;</span><span class="o">%</span><span class="p">(</span>
         <span class="n">__CHEETAH_version__</span><span class="p">,</span> <span class="n">RequiredCheetahVersion</span><span class="p">))</span>

<span class="c1">##################################################</span>
<span class="c1">## CLASSES</span>

<div class="viewcode-block" id="layout"><a class="viewcode-back" href="../../../../api/m_librarian.web.views.layout.html#m_librarian.web.views.layout.layout">[документация]</a><span class="k">class</span> <span class="nc">layout</span><span class="p">(</span><span class="n">Template</span><span class="p">):</span>

    <span class="c1">##################################################</span>
    <span class="c1">## CHEETAH GENERATED METHODS</span>


    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">KWs</span><span class="p">):</span>

        <span class="nb">super</span><span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">KWs</span><span class="p">)</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_CHEETAH__instanceInitialized</span><span class="p">:</span>
            <span class="n">cheetahKWArgs</span> <span class="o">=</span> <span class="p">{}</span>
            <span class="n">allowedKWs</span> <span class="o">=</span> <span class="s1">&#39;searchList namespaces filter filtersLib errorCatcher&#39;</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
            <span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">KWs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
                <span class="k">if</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">allowedKWs</span><span class="p">:</span> <span class="n">cheetahKWArgs</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">v</span>
            <span class="bp">self</span><span class="o">.</span><span class="n">_initCheetahInstance</span><span class="p">(</span><span class="o">**</span><span class="n">cheetahKWArgs</span><span class="p">)</span>
        

<div class="viewcode-block" id="layout.respond"><a class="viewcode-back" href="../../../../api/m_librarian.web.views.layout.html#m_librarian.web.views.layout.layout.respond">[документация]</a>    <span class="k">def</span> <span class="nf">respond</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">trans</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>



        <span class="c1">## CHEETAH: main method generated for this template</span>
        <span class="k">if</span> <span class="p">(</span><span class="ow">not</span> <span class="n">trans</span> <span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_CHEETAH__isBuffering</span> <span class="ow">and</span> <span class="ow">not</span> <span class="n">callable</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">transaction</span><span class="p">)):</span>
            <span class="n">trans</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">transaction</span> <span class="c1"># is None unless self.awake() was called</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="n">trans</span><span class="p">:</span>
            <span class="n">trans</span> <span class="o">=</span> <span class="n">DummyTransaction</span><span class="p">()</span>
            <span class="n">_dummyTrans</span> <span class="o">=</span> <span class="kc">True</span>
        <span class="k">else</span><span class="p">:</span> <span class="n">_dummyTrans</span> <span class="o">=</span> <span class="kc">False</span>
        <span class="n">write</span> <span class="o">=</span> <span class="n">trans</span><span class="o">.</span><span class="n">response</span><span class="p">()</span><span class="o">.</span><span class="n">write</span>
        <span class="n">SL</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_CHEETAH__searchList</span>
        <span class="n">_filter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_CHEETAH__currentFilter</span>
        
        <span class="c1">########################################</span>
        <span class="c1">## START - generated method body</span>
        
        <span class="n">write</span><span class="p">(</span><span class="sa">u</span><span class="s1">&#39;&#39;&#39;&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span>
<span class="s1">   &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</span>
<span class="s1">&lt;html&gt;</span>
<span class="s1">&lt;!-- THIS PAGE IS AUTOMATICALLY GENERATED USING CheetahTemplate. DO NOT EDIT. --&gt;</span>
<span class="s1">&lt;head&gt;</span>
<span class="s1">&lt;meta HTTP-Equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;</span>
<span class="s1">&lt;title&gt;&#39;&#39;&#39;</span><span class="p">)</span>
        <span class="n">_v</span> <span class="o">=</span> <span class="n">VFFSL</span><span class="p">(</span><span class="n">SL</span><span class="p">,</span><span class="s2">&quot;title&quot;</span><span class="p">,</span><span class="kc">True</span><span class="p">)</span> <span class="c1"># u&#39;$title&#39; on line 9, col 8</span>
        <span class="k">if</span> <span class="n">_v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">write</span><span class="p">(</span><span class="n">_filter</span><span class="p">(</span><span class="n">_v</span><span class="p">,</span> <span class="n">rawExpr</span><span class="o">=</span><span class="sa">u</span><span class="s1">&#39;$title&#39;</span><span class="p">))</span> <span class="c1"># from line 9, col 8.</span>
        <span class="n">write</span><span class="p">(</span><span class="sa">u</span><span class="s1">&#39;&#39;&#39; </span><span class="se">\u2014</span><span class="s1"> m_Librarian&lt;/title&gt;</span>
<span class="s1">&lt;meta name=&quot;author&quot; content=&quot;Oleg Broytman&quot;&gt;</span>
<span class="s1">&lt;meta name=&quot;copyright&quot; content=&quot;&amp;copy; 2018 PhiloSoft Design&quot;&gt;</span>
<span class="s1">&lt;link rev=&quot;made&quot; href=&quot;mailto:phd@phdru.name&quot;&gt;</span>
<span class="s1">&lt;meta name=&quot;generator&quot; content=&quot;CheetahTemplate&quot;&gt;</span>
<span class="s1">&lt;meta name=&quot;MSSmartTagsPreventParsing&quot; content=&quot;TRUE&quot;&gt; &lt;!-- MUST DIE --&gt;</span>
<span class="s1">&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; href=&quot;/static/style.css&quot;&gt;</span>
<span class="s1">&lt;/head&gt;</span>
<span class="s1">&lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;</span>
<span class="s1">      link=&quot;#0000bb&quot;  vlink=&quot;#551a8b&quot; alink=&quot;#ff0000&quot;&gt;</span>
<span class="s1">&lt;table style=&quot;width: 100%&quot;&gt;</span>
<span class="s1">&lt;tr style=&quot;width: 100%&quot;&gt;</span>
<span class="s1">  &lt;td style=&quot;width: 50%&quot;&gt;&lt;p&gt;m_Librarian&lt;/p&gt;&lt;/td&gt;</span>
<span class="s1">  &lt;td style=&quot;width: 50%; text-align: right&quot;&gt;&lt;a href=&quot;/quit&quot;&gt;</span><span class="se">\u0412\u044b\u0445\u043e\u0434</span><span class="s1">&lt;/a&gt;&lt;/td&gt;</span>
<span class="s1">&lt;/tr&gt;</span>
<span class="s1">&lt;/table&gt;</span>
<span class="s1">&#39;&#39;&#39;</span><span class="p">)</span>
        <span class="n">_v</span> <span class="o">=</span> <span class="n">VFFSL</span><span class="p">(</span><span class="n">SL</span><span class="p">,</span><span class="s2">&quot;body&quot;</span><span class="p">,</span><span class="kc">True</span><span class="p">)</span> <span class="c1"># u&#39;$body&#39; on line 25, col 1</span>
        <span class="k">if</span> <span class="n">_v</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> <span class="n">write</span><span class="p">(</span><span class="n">_filter</span><span class="p">(</span><span class="n">_v</span><span class="p">,</span> <span class="n">rawExpr</span><span class="o">=</span><span class="sa">u</span><span class="s1">&#39;$body&#39;</span><span class="p">))</span> <span class="c1"># from line 25, col 1.</span>
        <span class="n">write</span><span class="p">(</span><span class="sa">u</span><span class="s1">&#39;&#39;&#39;</span>
<span class="s1">&lt;/body&gt;</span>
<span class="s1">&lt;/html&gt;</span>
<span class="s1">&#39;&#39;&#39;</span><span class="p">)</span>
        
        <span class="c1">########################################</span>
        <span class="c1">## END - generated method body</span>
        
        <span class="k">return</span> <span class="n">_dummyTrans</span> <span class="ow">and</span> <span class="n">trans</span><span class="o">.</span><span class="n">response</span><span class="p">()</span><span class="o">.</span><span class="n">getvalue</span><span class="p">()</span> <span class="ow">or</span> <span class="s2">&quot;&quot;</span></div>
        
    <span class="c1">##################################################</span>
    <span class="c1">## CHEETAH GENERATED ATTRIBUTES</span>


    <span class="n">_CHEETAH__instanceInitialized</span> <span class="o">=</span> <span class="kc">False</span>

    <span class="n">_CHEETAH_version</span> <span class="o">=</span> <span class="n">__CHEETAH_version__</span>

    <span class="n">_CHEETAH_versionTuple</span> <span class="o">=</span> <span class="n">__CHEETAH_versionTuple__</span>

    <span class="n">_CHEETAH_genTime</span> <span class="o">=</span> <span class="n">__CHEETAH_genTime__</span>

    <span class="n">_CHEETAH_genTimestamp</span> <span class="o">=</span> <span class="n">__CHEETAH_genTimestamp__</span>

    <span class="n">_CHEETAH_src</span> <span class="o">=</span> <span class="n">__CHEETAH_src__</span>

    <span class="n">_CHEETAH_srcLastModified</span> <span class="o">=</span> <span class="n">__CHEETAH_srcLastModified__</span>

    <span class="n">title</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>

    <span class="n">_mainCheetahMethod_for_layout</span> <span class="o">=</span> <span class="s1">&#39;respond&#39;</span></div>

<span class="c1">## END CLASS DEFINITION</span>

<span class="k">if</span> <span class="ow">not</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">layout</span><span class="p">,</span> <span class="s1">&#39;_initCheetahAttributes&#39;</span><span class="p">):</span>
    <span class="n">templateAPIClass</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">layout</span><span class="p">,</span>
                               <span class="s1">&#39;_CHEETAH_templateClass&#39;</span><span class="p">,</span>
                               <span class="n">Template</span><span class="p">)</span>
    <span class="n">templateAPIClass</span><span class="o">.</span><span class="n">_addCheetahPlumbingCodeToClass</span><span class="p">(</span><span class="n">layout</span><span class="p">)</span>


<span class="c1"># CHEETAH was developed by Tavis Rudd and Mike Orr</span>
<span class="c1"># with code, advice and input from many other volunteers.</span>
<span class="c1"># For more information visit http://cheetahtemplate.org/</span>

<span class="c1">##################################################</span>
<span class="c1">## if run from command line:</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">&#39;__main__&#39;</span><span class="p">:</span>
    <span class="kn">from</span> <span class="nn">Cheetah.TemplateCmdLineIface</span> <span class="k">import</span> <span class="n">CmdLineIface</span>
    <span class="n">CmdLineIface</span><span class="p">(</span><span class="n">templateObj</span><span class="o">=</span><span class="n">layout</span><span class="p">())</span><span class="o">.</span><span class="n">run</span><span class="p">()</span>


</pre></div>

          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3>Быстрый поиск</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Искать" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Навигация</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="Алфавитный указатель"
             >указатель</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Содержание модулей Python"
             >модули</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">Документация m_Librarian 0.1.2</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >Код модуля</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2015-2018, Oleg Broytman.
      Создано с помощью <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.3.
    </div>
  </body>
</html>