/usr/share/doc/python-terminado-doc/html/index.html is in python-terminado-doc 0.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | <!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>Terminado — Terminado 0.7 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.7',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Using the TermSocket handler" href="websocket.html" />
</head>
<body>
<div class="related" role="navigation" aria-label="related navigation">
<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="websocket.html" title="Using the TermSocket handler"
accesskey="N">next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">Terminado 0.7 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="terminado">
<h1>Terminado<a class="headerlink" href="#terminado" title="Permalink to this headline">¶</a></h1>
<p>Contents:</p>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="websocket.html">Using the TermSocket handler</a><ul>
<li class="toctree-l2"><a class="reference internal" href="websocket.html#terminal-managers">Terminal managers</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="uimodule.html">Using the Tornado UI Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="releasenotes.html">Release notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="releasenotes.html#id1">0.7</a></li>
</ul>
</li>
</ul>
</div>
<p>This is a <a class="reference external" href="http://tornadoweb.org/">Tornado</a> websocket backend for the
<a class="reference external" href="https://github.com/chjj/term.js">term.js</a> Javascript terminal emulator
library.</p>
<p>It evolved out of <a class="reference external" href="https://github.com/mitotic/pyxterm">pyxterm</a>, which was
part of <a class="reference external" href="https://github.com/mitotic/graphterm">GraphTerm</a> (as lineterm.py),
v0.57.0 (2014-07-18), and ultimately derived from the public-domain <a class="reference external" href="http://antony.lesuisse.org/software/ajaxterm/">Ajaxterm</a> code, v0.11 (2008-11-13) (also
on Github as part of <a class="reference external" href="https://github.com/antonylesuisse/qweb">QWeb</a>).</p>
<p>Modules:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">terminado.management</span></code>: controls launching virtual terminals,
connecting them to Tornado’s event loop, and closing them down.</li>
<li><code class="docutils literal"><span class="pre">terminado.websocket</span></code>: Provides a websocket handler for communicating with
a terminal.</li>
<li><code class="docutils literal"><span class="pre">terminado.uimodule</span></code>: Provides a <code class="docutils literal"><span class="pre">Terminal</span></code> Tornado <a class="reference external" href="http://www.tornadoweb.org/en/stable/guide/templates.html#ui-modules">UI Module</a>.</li>
</ul>
<p>JS:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">terminado/_static/terminado.js</span></code>: A lightweight wrapper to set up a
term.js terminal with a websocket.</li>
</ul>
<p>Usage example:</p>
<div class="code python highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">os.path</span>
<span class="kn">import</span> <span class="nn">tornado.web</span>
<span class="kn">import</span> <span class="nn">tornado.ioloop</span>
<span class="c1"># This demo requires tornado_xstatic and XStatic-term.js</span>
<span class="kn">import</span> <span class="nn">tornado_xstatic</span>
<span class="kn">import</span> <span class="nn">terminado</span>
<span class="n">STATIC_DIR</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="n">terminado</span><span class="o">.</span><span class="vm">__file__</span><span class="p">),</span> <span class="s2">"_static"</span><span class="p">)</span>
<span class="k">class</span> <span class="nc">TerminalPageHandler</span><span class="p">(</span><span class="n">tornado</span><span class="o">.</span><span class="n">web</span><span class="o">.</span><span class="n">RequestHandler</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="s2">"termpage.html"</span><span class="p">,</span> <span class="n">static</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">static_url</span><span class="p">,</span>
<span class="n">xstatic</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">application</span><span class="o">.</span><span class="n">settings</span><span class="p">[</span><span class="s1">'xstatic_url'</span><span class="p">],</span>
<span class="n">ws_url_path</span><span class="o">=</span><span class="s2">"/websocket"</span><span class="p">)</span>
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
<span class="n">term_manager</span> <span class="o">=</span> <span class="n">terminado</span><span class="o">.</span><span class="n">SingleTermManager</span><span class="p">(</span><span class="n">shell_command</span><span class="o">=</span><span class="p">[</span><span class="s1">'bash'</span><span class="p">])</span>
<span class="n">handlers</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">(</span><span class="sa">r</span><span class="s2">"/websocket"</span><span class="p">,</span> <span class="n">terminado</span><span class="o">.</span><span class="n">TermSocket</span><span class="p">,</span>
<span class="p">{</span><span class="s1">'term_manager'</span><span class="p">:</span> <span class="n">term_manager</span><span class="p">}),</span>
<span class="p">(</span><span class="sa">r</span><span class="s2">"/"</span><span class="p">,</span> <span class="n">TerminalPageHandler</span><span class="p">),</span>
<span class="p">(</span><span class="sa">r</span><span class="s2">"/xstatic/(.*)"</span><span class="p">,</span> <span class="n">tornado_xstatic</span><span class="o">.</span><span class="n">XStaticFileHandler</span><span class="p">,</span>
<span class="p">{</span><span class="s1">'allowed_modules'</span><span class="p">:</span> <span class="p">[</span><span class="s1">'termjs'</span><span class="p">]})</span>
<span class="p">]</span>
<span class="n">app</span> <span class="o">=</span> <span class="n">tornado</span><span class="o">.</span><span class="n">web</span><span class="o">.</span><span class="n">Application</span><span class="p">(</span><span class="n">handlers</span><span class="p">,</span> <span class="n">static_path</span><span class="o">=</span><span class="n">STATIC_DIR</span><span class="p">,</span>
<span class="n">xstatic_url</span> <span class="o">=</span> <span class="n">tornado_xstatic</span><span class="o">.</span><span class="n">url_maker</span><span class="p">(</span><span class="s1">'/xstatic/'</span><span class="p">))</span>
<span class="c1"># Serve at http://localhost:8765/ N.B. Leaving out 'localhost' here will</span>
<span class="c1"># work, but it will listen on the public network interface as well.</span>
<span class="c1"># Given what terminado does, that would be rather a security hole.</span>
<span class="n">app</span><span class="o">.</span><span class="n">listen</span><span class="p">(</span><span class="mi">8765</span><span class="p">,</span> <span class="s1">'localhost'</span><span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">tornado</span><span class="o">.</span><span class="n">ioloop</span><span class="o">.</span><span class="n">IOLoop</span><span class="o">.</span><span class="n">instance</span><span class="p">()</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="k">finally</span><span class="p">:</span>
<span class="n">term_manager</span><span class="o">.</span><span class="n">shutdown</span><span class="p">()</span>
</pre></div>
</div>
<p>See the <a class="reference external" href="https://github.com/takluyver/terminado/tree/master/demos">demos directory</a>
for more examples. This is a simplified version of the <code class="docutils literal"><span class="pre">single.py</span></code> demo.</p>
<p>Run the unit tests with:</p>
<blockquote>
<div>$ nosetests</div></blockquote>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Terminado</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
<h4>Next topic</h4>
<p class="topless"><a href="websocket.html"
title="next chapter">Using the TermSocket handler</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</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>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="websocket.html" title="Using the TermSocket handler"
>next</a> |</li>
<li class="nav-item nav-item-0"><a href="#">Terminado 0.7 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2017, Thomas Kluyver.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
</div>
</body>
</html>
|