Python Library Stringtools
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.html 46KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Welcome to stringtools’s documentation! &#8212; stringtools documentation</title>
  7. <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true,
  16. SOURCELINK_SUFFIX: '.txt'
  17. };
  18. </script>
  19. <script type="text/javascript" src="_static/jquery.js"></script>
  20. <script type="text/javascript" src="_static/underscore.js"></script>
  21. <script type="text/javascript" src="_static/doctools.js"></script>
  22. <link rel="index" title="Index" href="genindex.html" />
  23. <link rel="search" title="Search" href="search.html" />
  24. <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  25. <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
  26. </head>
  27. <body>
  28. <div class="document">
  29. <div class="documentwrapper">
  30. <div class="bodywrapper">
  31. <div class="body" role="main">
  32. <div class="section" id="module-stringtools">
  33. <span id="welcome-to-stringtools-s-documentation"></span><h1>Welcome to stringtools’s documentation!<a class="headerlink" href="#module-stringtools" title="Permalink to this headline">¶</a></h1>
  34. <div class="section" id="stringtools-stringtools">
  35. <h2>stringtools (Stringtools)<a class="headerlink" href="#stringtools-stringtools" title="Permalink to this headline">¶</a></h2>
  36. <p><strong>Author:</strong></p>
  37. <ul class="simple">
  38. <li>Dirk Alders &lt;<a class="reference external" href="mailto:sudo-dirk&#37;&#52;&#48;mount-mockery&#46;de">sudo-dirk<span>&#64;</span>mount-mockery<span>&#46;</span>de</a>&gt;</li>
  39. </ul>
  40. <p><strong>Description:</strong></p>
  41. <blockquote>
  42. <div>This Module supports functionality around string operations.</div></blockquote>
  43. <p><strong>Submodules:</strong></p>
  44. <ul class="simple">
  45. <li><a class="reference internal" href="#module-stringtools.csp" title="stringtools.csp"><code class="xref py py-mod docutils literal"><span class="pre">stringtools.csp</span></code></a></li>
  46. <li><a class="reference internal" href="#module-stringtools.stp" title="stringtools.stp"><code class="xref py py-mod docutils literal"><span class="pre">stringtools.stp</span></code></a></li>
  47. <li><a class="reference internal" href="#stringtools.gzip_compress" title="stringtools.gzip_compress"><code class="xref py py-func docutils literal"><span class="pre">gzip_compress()</span></code></a></li>
  48. <li><a class="reference internal" href="#stringtools.gzip_extract" title="stringtools.gzip_extract"><code class="xref py py-func docutils literal"><span class="pre">gzip_extract()</span></code></a></li>
  49. <li><a class="reference internal" href="#stringtools.hexlify" title="stringtools.hexlify"><code class="xref py py-func docutils literal"><span class="pre">hexlify()</span></code></a></li>
  50. </ul>
  51. <p><strong>Unittest:</strong></p>
  52. <blockquote>
  53. <div>See also the <a class="reference download internal" href="_downloads/unittest.pdf" download=""><code class="xref download docutils literal"><span class="pre">unittest</span></code></a> documentation.</div></blockquote>
  54. <p><strong>Module Documentation:</strong></p>
  55. <dl class="function">
  56. <dt id="stringtools.gzip_compress">
  57. <code class="descclassname">stringtools.</code><code class="descname">gzip_compress</code><span class="sig-paren">(</span><em>s</em>, <em>compresslevel=9</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.gzip_compress" title="Permalink to this definition">¶</a></dt>
  58. <dd><p>Method to compress a stream of bytes.</p>
  59. <table class="docutils field-list" frame="void" rules="none">
  60. <col class="field-name" />
  61. <col class="field-body" />
  62. <tbody valign="top">
  63. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  64. <li><strong>s</strong> (<em>str</em>) – The bytestream (string) to be compressed</li>
  65. <li><strong>compresslevel</strong> (<em>int</em>) – An optional compressionn level (default is 9)</li>
  66. </ul>
  67. </td>
  68. </tr>
  69. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The compressed bytestream</p>
  70. </td>
  71. </tr>
  72. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p>
  73. </td>
  74. </tr>
  75. </tbody>
  76. </table>
  77. <p><strong>Example:</strong></p>
  78. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
  79. <span class="kn">import</span> <span class="nn">report</span>
  80. <span class="kn">import</span> <span class="nn">logging</span>
  81. <span class="kn">import</span> <span class="nn">sys</span>
  82. <span class="n">logger</span> <span class="o">=</span> <span class="n">report</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;example&#39;</span><span class="p">,</span> <span class="p">[(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">logging</span><span class="o">.</span><span class="n">StreamHandler</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">))],</span> <span class="n">report</span><span class="o">.</span><span class="n">SHORT_FMT</span><span class="p">)</span>
  83. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">gzip_compress</span><span class="p">(</span><span class="mi">15</span> <span class="o">*</span> <span class="sa">b</span><span class="s1">&#39;</span><span class="se">\x00</span><span class="s1">&#39;</span> <span class="o">+</span> <span class="mi">15</span> <span class="o">*</span> <span class="sa">b</span><span class="s1">&#39;</span><span class="se">\xff</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="n">logger</span><span class="p">)))</span>
  84. </pre></div>
  85. </div>
  86. <p>Will result to the following output:</p>
  87. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">19</span><span class="p">:</span><span class="mi">14</span><span class="p">:</span><span class="mi">02</span><span class="p">,</span><span class="mi">852</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Finished</span> <span class="n">to</span> <span class="n">compress</span> <span class="n">a</span> <span class="n">string</span> <span class="p">(</span><span class="n">compression_rate</span><span class="o">=</span><span class="mf">0.867</span><span class="p">,</span> <span class="n">consumed_time</span><span class="o">=</span><span class="mf">0.0</span><span class="n">s</span><span class="p">)</span><span class="o">.</span>
  88. <span class="p">(</span><span class="mi">26</span><span class="p">):</span> <span class="mi">1</span><span class="n">f</span> <span class="mi">8</span><span class="n">b</span> <span class="mi">08</span> <span class="mi">00</span> <span class="mi">5</span><span class="n">a</span> <span class="mi">83</span> <span class="n">e5</span> <span class="mi">5</span><span class="n">c</span> <span class="mi">02</span> <span class="n">ff</span> <span class="mi">63</span> <span class="mi">60</span> <span class="mi">40</span> <span class="mi">01</span> <span class="n">ff</span> <span class="mi">51</span> <span class="mi">01</span> <span class="mi">00</span> <span class="mi">2</span><span class="n">d</span> <span class="mi">8</span><span class="n">a</span> <span class="mi">7</span><span class="n">d</span> <span class="n">de</span> <span class="mi">1</span><span class="n">e</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span>
  89. </pre></div>
  90. </div>
  91. </dd></dl>
  92. <dl class="function">
  93. <dt id="stringtools.gzip_extract">
  94. <code class="descclassname">stringtools.</code><code class="descname">gzip_extract</code><span class="sig-paren">(</span><em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.gzip_extract" title="Permalink to this definition">¶</a></dt>
  95. <dd><p>Method to extract data from a compress stream of bytes.</p>
  96. <table class="docutils field-list" frame="void" rules="none">
  97. <col class="field-name" />
  98. <col class="field-body" />
  99. <tbody valign="top">
  100. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>s</strong> (<em>str</em>) – The compressed bytestream (string) to be extracted</td>
  101. </tr>
  102. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The extracted data</td>
  103. </tr>
  104. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <p><strong>Example:</strong></p>
  109. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
  110. <span class="kn">import</span> <span class="nn">report</span>
  111. <span class="kn">import</span> <span class="nn">logging</span>
  112. <span class="kn">import</span> <span class="nn">sys</span>
  113. <span class="n">logger</span> <span class="o">=</span> <span class="n">report</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;example&#39;</span><span class="p">,</span> <span class="p">[(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">logging</span><span class="o">.</span><span class="n">StreamHandler</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">))],</span> <span class="n">report</span><span class="o">.</span><span class="n">SHORT_FMT</span><span class="p">)</span>
  114. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">gzip_extract</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;</span><span class="se">\x1f\x8b\x08\x00\xd0\x82\xe5\x5c\x02\xff\x63\x60\x40\x01\xff\x51\x01\x00\x2d\x8a\x7d\xde\x1e\x00\x00\x00</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">logger</span><span class="o">=</span><span class="n">logger</span><span class="p">)))</span>
  115. </pre></div>
  116. </div>
  117. <p>Will result to the following output:</p>
  118. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">19</span><span class="p">:</span><span class="mi">14</span><span class="p">:</span><span class="mi">09</span><span class="p">,</span><span class="mi">390</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Finished</span> <span class="n">to</span> <span class="n">extract</span> <span class="n">a</span> <span class="n">string</span> <span class="p">(</span><span class="n">compression_rate</span><span class="o">=</span><span class="mf">0.867</span><span class="p">,</span> <span class="n">consumed_time</span><span class="o">=</span><span class="mf">0.0</span><span class="n">s</span><span class="p">)</span><span class="o">.</span>
  119. <span class="p">(</span><span class="mi">30</span><span class="p">):</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="mi">00</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span> <span class="n">ff</span>
  120. </pre></div>
  121. </div>
  122. </dd></dl>
  123. <dl class="function">
  124. <dt id="stringtools.hexlify">
  125. <code class="descclassname">stringtools.</code><code class="descname">hexlify</code><span class="sig-paren">(</span><em>s</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.hexlify" title="Permalink to this definition">¶</a></dt>
  126. <dd><p>Method to hexlify a string.</p>
  127. <table class="docutils field-list" frame="void" rules="none">
  128. <col class="field-name" />
  129. <col class="field-body" />
  130. <tbody valign="top">
  131. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>s</strong> (<em>str</em>) – A string including the bytes to be hexlified.</td>
  132. </tr>
  133. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The hexlified string</td>
  134. </tr>
  135. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  136. </tr>
  137. </tbody>
  138. </table>
  139. <p><strong>Example:</strong></p>
  140. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
  141. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;A stringexample with non printable characters like </span><span class="se">\x12</span><span class="s1">&#39;</span><span class="p">))</span>
  142. </pre></div>
  143. </div>
  144. <p>Will result to the following output:</p>
  145. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">(</span><span class="mi">52</span><span class="p">):</span> <span class="mi">41</span> <span class="mi">20</span> <span class="mi">73</span> <span class="mi">74</span> <span class="mi">72</span> <span class="mi">69</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">67</span> <span class="mi">65</span> <span class="mi">78</span> <span class="mi">61</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">70</span> <span class="mi">6</span><span class="n">c</span> <span class="mi">65</span> <span class="mi">20</span> <span class="mi">77</span> <span class="mi">69</span> <span class="mi">74</span> <span class="mi">68</span> <span class="mi">20</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">6</span><span class="n">f</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">20</span> <span class="mi">70</span> <span class="mi">72</span> <span class="mi">69</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">74</span> <span class="mi">61</span> <span class="mi">62</span> <span class="mi">6</span><span class="n">c</span> <span class="mi">65</span> <span class="mi">20</span> <span class="mi">63</span> <span class="mi">68</span> <span class="mi">61</span> <span class="mi">72</span> <span class="mi">61</span> <span class="mi">63</span> <span class="mi">74</span> <span class="mi">65</span> <span class="mi">72</span> <span class="mi">73</span> <span class="mi">20</span> <span class="mi">6</span><span class="n">c</span> <span class="mi">69</span> <span class="mi">6</span><span class="n">b</span> <span class="mi">65</span> <span class="mi">20</span> <span class="mi">12</span>
  146. </pre></div>
  147. </div>
  148. </dd></dl>
  149. </div>
  150. <span class="target" id="module-stringtools.csp"></span><div class="section" id="csp-carriage-return-seperation-protocol">
  151. <h2>csp (Carriage-Return seperation protocol)<a class="headerlink" href="#csp-carriage-return-seperation-protocol" title="Permalink to this headline">¶</a></h2>
  152. <p><strong>Author:</strong></p>
  153. <ul class="simple">
  154. <li>Dirk Alders &lt;<a class="reference external" href="mailto:sudo-dirk&#37;&#52;&#48;mount-mockery&#46;de">sudo-dirk<span>&#64;</span>mount-mockery<span>&#46;</span>de</a>&gt;</li>
  155. </ul>
  156. <p><strong>Description:</strong></p>
  157. <blockquote>
  158. <div>This module is a submodule of <a class="reference internal" href="#module-stringtools" title="stringtools"><code class="xref py py-mod docutils literal"><span class="pre">stringtools</span></code></a> and creates an frame to transmit and receive messages via an serial interface.</div></blockquote>
  159. <p><strong>Submodules:</strong></p>
  160. <ul class="simple">
  161. <li><a class="reference internal" href="#stringtools.csp.csp" title="stringtools.csp.csp"><code class="xref py py-class docutils literal"><span class="pre">stringtools.csp.csp</span></code></a></li>
  162. <li><a class="reference internal" href="#stringtools.csp.build_frame" title="stringtools.csp.build_frame"><code class="xref py py-func docutils literal"><span class="pre">stringtools.csp.build_frame()</span></code></a></li>
  163. </ul>
  164. <dl class="function">
  165. <dt id="stringtools.csp.build_frame">
  166. <code class="descclassname">stringtools.csp.</code><code class="descname">build_frame</code><span class="sig-paren">(</span><em>msg</em>, <em>seperator='\n'</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.csp.build_frame" title="Permalink to this definition">¶</a></dt>
  167. <dd><p>This Method builds an “csp-frame” to be transfered via a stream.</p>
  168. <table class="docutils field-list" frame="void" rules="none">
  169. <col class="field-name" />
  170. <col class="field-body" />
  171. <tbody valign="top">
  172. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>str</em>) – A String (Bytes) to be framed</td>
  173. </tr>
  174. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The “csp-framed” message to be sent</td>
  175. </tr>
  176. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  177. </tr>
  178. </tbody>
  179. </table>
  180. <p><strong>Example:</strong></p>
  181. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
  182. <span class="n">data</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">&#39;message&#39;</span>
  183. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
  184. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">hexlify</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">csp</span><span class="o">.</span><span class="n">build_frame</span><span class="p">(</span><span class="n">data</span><span class="p">)))</span>
  185. </pre></div>
  186. </div>
  187. <p>Will result to the following output:</p>
  188. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">(</span><span class="mi">7</span><span class="p">):</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">65</span> <span class="mi">73</span> <span class="mi">73</span> <span class="mi">61</span> <span class="mi">67</span> <span class="mi">65</span>
  189. <span class="p">(</span><span class="mi">8</span><span class="p">):</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">65</span> <span class="mi">73</span> <span class="mi">73</span> <span class="mi">61</span> <span class="mi">67</span> <span class="mi">65</span> <span class="mi">0</span><span class="n">a</span>
  190. </pre></div>
  191. </div>
  192. </dd></dl>
  193. <dl class="class">
  194. <dt id="stringtools.csp.csp">
  195. <em class="property">class </em><code class="descclassname">stringtools.csp.</code><code class="descname">csp</code><span class="sig-paren">(</span><em>seperator='n'</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.csp.csp" title="Permalink to this definition">¶</a></dt>
  196. <dd><p>This class extracts messages from an “csp-stream”.</p>
  197. <p><strong>Example:</strong></p>
  198. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span>
  199. <span class="kn">import</span> <span class="nn">report</span>
  200. <span class="kn">import</span> <span class="nn">stringtools</span>
  201. <span class="kn">import</span> <span class="nn">sys</span>
  202. <span class="n">logger</span> <span class="o">=</span> <span class="n">report</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;example&#39;</span><span class="p">,</span> <span class="p">[(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">logging</span><span class="o">.</span><span class="n">StreamHandler</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">))],</span> <span class="n">report</span><span class="o">.</span><span class="n">SHORT_FMT</span><span class="p">)</span>
  203. <span class="n">s</span> <span class="o">=</span> <span class="n">stringtools</span><span class="o">.</span><span class="n">csp</span><span class="o">.</span><span class="n">csp</span><span class="p">()</span>
  204. <span class="k">for</span> <span class="n">byte</span> <span class="ow">in</span> <span class="sa">b</span><span class="s1">&#39;message</span><span class="se">\n</span><span class="s1">&#39;</span><span class="p">:</span>
  205. <span class="n">data</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">process</span><span class="p">(</span><span class="n">byte</span><span class="p">,</span> <span class="n">logger</span><span class="p">)</span>
  206. <span class="k">if</span> <span class="n">data</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
  207. <span class="nb">print</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
  208. </pre></div>
  209. </div>
  210. <p>Will result to the following output:</p>
  211. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;m&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  212. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;e&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  213. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;s&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  214. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;s&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  215. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;a&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  216. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;g&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  217. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Adding</span> <span class="sa">b</span><span class="s1">&#39;e&#39;</span> <span class="n">to</span> <span class="n">buffer</span>
  218. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">41</span><span class="p">:</span><span class="mi">54</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Message</span> <span class="n">identified</span> <span class="n">by</span> <span class="n">seperator</span> <span class="mi">0</span><span class="n">a</span>
  219. <span class="sa">b</span><span class="s1">&#39;message&#39;</span>
  220. </pre></div>
  221. </div>
  222. <dl class="method">
  223. <dt id="stringtools.csp.csp.process">
  224. <code class="descname">process</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.csp.csp.process" title="Permalink to this definition">¶</a></dt>
  225. <dd><p>This processes a byte out of a “stp-stream”.</p>
  226. <table class="docutils field-list" frame="void" rules="none">
  227. <col class="field-name" />
  228. <col class="field-body" />
  229. <tbody valign="top">
  230. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>bytes</em>) – A byte stream</td>
  231. </tr>
  232. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A list of the extracted message(s)</td>
  233. </tr>
  234. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">list</td>
  235. </tr>
  236. </tbody>
  237. </table>
  238. </dd></dl>
  239. </dd></dl>
  240. </div>
  241. <span class="target" id="module-stringtools.stp"></span><div class="section" id="stp-serial-transfer-protocol">
  242. <h2>stp (Serial transfer protocol)<a class="headerlink" href="#stp-serial-transfer-protocol" title="Permalink to this headline">¶</a></h2>
  243. <p><strong>Author:</strong></p>
  244. <ul class="simple">
  245. <li>Dirk Alders &lt;<a class="reference external" href="mailto:sudo-dirk&#37;&#52;&#48;mount-mockery&#46;de">sudo-dirk<span>&#64;</span>mount-mockery<span>&#46;</span>de</a>&gt;</li>
  246. </ul>
  247. <p><strong>Description:</strong></p>
  248. <blockquote>
  249. <div>This module is a submodule of <a class="reference internal" href="#module-stringtools" title="stringtools"><code class="xref py py-mod docutils literal"><span class="pre">stringtools</span></code></a> and creates an serial frame to transmit and receive messages via an serial interface.</div></blockquote>
  250. <p><strong>Submodules:</strong></p>
  251. <ul class="simple">
  252. <li><a class="reference internal" href="#stringtools.stp.stp" title="stringtools.stp.stp"><code class="xref py py-class docutils literal"><span class="pre">stringtools.stp.stp</span></code></a></li>
  253. <li><a class="reference internal" href="#stringtools.stp.build_frame" title="stringtools.stp.build_frame"><code class="xref py py-func docutils literal"><span class="pre">stringtools.stp.build_frame()</span></code></a></li>
  254. </ul>
  255. <dl class="data">
  256. <dt id="stringtools.stp.DATA_CLEAR_BUFFER">
  257. <code class="descclassname">stringtools.stp.</code><code class="descname">DATA_CLEAR_BUFFER</code><em class="property"> = '&lt;'</em><a class="headerlink" href="#stringtools.stp.DATA_CLEAR_BUFFER" title="Permalink to this definition">¶</a></dt>
  258. <dd><p>The clear buffer byte (‘\x3a\x3c’ -&gt; start of message)</p>
  259. </dd></dl>
  260. <dl class="data">
  261. <dt id="stringtools.stp.DATA_STORE_SYNC_VALUE">
  262. <code class="descclassname">stringtools.stp.</code><code class="descname">DATA_STORE_SYNC_VALUE</code><em class="property"> = '='</em><a class="headerlink" href="#stringtools.stp.DATA_STORE_SYNC_VALUE" title="Permalink to this definition">¶</a></dt>
  263. <dd><p>The store sync value byte (‘\x3a\x3d’ -&gt; ‘\x3a’ inside a message)</p>
  264. </dd></dl>
  265. <dl class="data">
  266. <dt id="stringtools.stp.DATA_SYNC">
  267. <code class="descclassname">stringtools.stp.</code><code class="descname">DATA_SYNC</code><em class="property"> = ':'</em><a class="headerlink" href="#stringtools.stp.DATA_SYNC" title="Permalink to this definition">¶</a></dt>
  268. <dd><p>The data sync byte</p>
  269. </dd></dl>
  270. <dl class="data">
  271. <dt id="stringtools.stp.DATA_VALID_MSG">
  272. <code class="descclassname">stringtools.stp.</code><code class="descname">DATA_VALID_MSG</code><em class="property"> = '&gt;'</em><a class="headerlink" href="#stringtools.stp.DATA_VALID_MSG" title="Permalink to this definition">¶</a></dt>
  273. <dd><p>The valid message byte (‘\x3a\x3e’ -&gt; end of message)</p>
  274. </dd></dl>
  275. <dl class="data">
  276. <dt id="stringtools.stp.STP_STATE_ESCAPE_1">
  277. <code class="descclassname">stringtools.stp.</code><code class="descname">STP_STATE_ESCAPE_1</code><em class="property"> = 1</em><a class="headerlink" href="#stringtools.stp.STP_STATE_ESCAPE_1" title="Permalink to this definition">¶</a></dt>
  278. <dd><p>Escape 1 state definition (‘\x3a\x3c’ found)</p>
  279. </dd></dl>
  280. <dl class="data">
  281. <dt id="stringtools.stp.STP_STATE_ESCAPE_2">
  282. <code class="descclassname">stringtools.stp.</code><code class="descname">STP_STATE_ESCAPE_2</code><em class="property"> = 2</em><a class="headerlink" href="#stringtools.stp.STP_STATE_ESCAPE_2" title="Permalink to this definition">¶</a></dt>
  283. <dd><p>Escape 2 state definition (‘\x3a’ found inside a message)</p>
  284. </dd></dl>
  285. <dl class="data">
  286. <dt id="stringtools.stp.STP_STATE_IDLE">
  287. <code class="descclassname">stringtools.stp.</code><code class="descname">STP_STATE_IDLE</code><em class="property"> = 0</em><a class="headerlink" href="#stringtools.stp.STP_STATE_IDLE" title="Permalink to this definition">¶</a></dt>
  288. <dd><p>Idle state definition (default)</p>
  289. </dd></dl>
  290. <dl class="data">
  291. <dt id="stringtools.stp.STP_STATE_STORE_DATA">
  292. <code class="descclassname">stringtools.stp.</code><code class="descname">STP_STATE_STORE_DATA</code><em class="property"> = 3</em><a class="headerlink" href="#stringtools.stp.STP_STATE_STORE_DATA" title="Permalink to this definition">¶</a></dt>
  293. <dd><p>Store data state definition (start of message found; data will be stored)</p>
  294. </dd></dl>
  295. <dl class="function">
  296. <dt id="stringtools.stp.build_frame">
  297. <code class="descclassname">stringtools.stp.</code><code class="descname">build_frame</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.stp.build_frame" title="Permalink to this definition">¶</a></dt>
  298. <dd><p>This Method builds an “stp-frame” to be transfered via a stream.</p>
  299. <table class="docutils field-list" frame="void" rules="none">
  300. <col class="field-name" />
  301. <col class="field-body" />
  302. <tbody valign="top">
  303. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>str</em>) – A String (Bytes) to be framed</td>
  304. </tr>
  305. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The “stp-framed” message to be sent</td>
  306. </tr>
  307. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  308. </tr>
  309. </tbody>
  310. </table>
  311. <p><strong>Example:</strong></p>
  312. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
  313. <span class="nb">print</span><span class="p">(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">stp</span><span class="o">.</span><span class="n">build_frame</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;:message:&#39;</span><span class="p">))</span>
  314. </pre></div>
  315. </div>
  316. <p>Will result to the following output:</p>
  317. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="sa">b</span><span class="s1">&#39;:&lt;:=message:=:&gt;&#39;</span>
  318. </pre></div>
  319. </div>
  320. </dd></dl>
  321. <dl class="class">
  322. <dt id="stringtools.stp.stp">
  323. <em class="property">class </em><code class="descclassname">stringtools.stp.</code><code class="descname">stp</code><a class="headerlink" href="#stringtools.stp.stp" title="Permalink to this definition">¶</a></dt>
  324. <dd><p>This class extracts messages from an “stp-stream”.</p>
  325. <p><strong>Example:</strong></p>
  326. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">logging</span>
  327. <span class="kn">import</span> <span class="nn">report</span>
  328. <span class="kn">import</span> <span class="nn">stringtools</span>
  329. <span class="kn">import</span> <span class="nn">sys</span>
  330. <span class="n">logger</span> <span class="o">=</span> <span class="n">report</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="s1">&#39;example&#39;</span><span class="p">,</span> <span class="p">[(</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">logging</span><span class="o">.</span><span class="n">StreamHandler</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">))],</span> <span class="n">report</span><span class="o">.</span><span class="n">SHORT_FMT</span><span class="p">)</span>
  331. <span class="n">s</span> <span class="o">=</span> <span class="n">stringtools</span><span class="o">.</span><span class="n">stp</span><span class="o">.</span><span class="n">stp</span><span class="p">()</span>
  332. <span class="k">for</span> <span class="n">byte</span> <span class="ow">in</span> <span class="sa">b</span><span class="s1">&#39;:&lt;:=message:=:&gt;&#39;</span><span class="p">:</span>
  333. <span class="n">data</span> <span class="o">=</span> <span class="n">s</span><span class="o">.</span><span class="n">process</span><span class="p">(</span><span class="n">byte</span><span class="p">,</span> <span class="n">logger</span><span class="p">)</span>
  334. <span class="k">if</span> <span class="n">data</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
  335. <span class="nb">print</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
  336. </pre></div>
  337. </div>
  338. <p>Will result to the following output:</p>
  339. <div class="highlight-default"><div class="highlight"><pre><span></span><span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">data</span> <span class="n">sync</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_IDLE</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_ESCAPE_1</span>
  340. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">clear</span> <span class="n">buffer</span> <span class="p">(</span><span class="mi">3</span><span class="n">c</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_ESCAPE_1</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_STORE_DATA</span>
  341. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">data</span> <span class="n">sync</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_STORE_DATA</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_ESCAPE_2</span>
  342. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">store</span> <span class="n">sync</span> <span class="n">value</span> <span class="p">(</span><span class="mi">3</span><span class="n">d</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_ESCAPE_2</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_STORE_DATA</span>
  343. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">data</span> <span class="n">sync</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_STORE_DATA</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_ESCAPE_2</span>
  344. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">store</span> <span class="n">sync</span> <span class="n">value</span> <span class="p">(</span><span class="mi">3</span><span class="n">d</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_ESCAPE_2</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_STORE_DATA</span>
  345. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">data</span> <span class="n">sync</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_STORE_DATA</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_ESCAPE_2</span>
  346. <span class="mi">2019</span><span class="o">-</span><span class="mi">05</span><span class="o">-</span><span class="mi">22</span> <span class="mi">18</span><span class="p">:</span><span class="mi">43</span><span class="p">:</span><span class="mi">14</span><span class="p">,</span><span class="mi">476</span><span class="p">:</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">message</span> <span class="n">completed</span> <span class="p">(</span><span class="mi">3</span><span class="n">e</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">changing</span> <span class="n">state</span> <span class="n">STP_STATE_ESCAPE_2</span> <span class="o">-&gt;</span> <span class="n">STP_STATE_IDLE</span>
  347. <span class="sa">b</span><span class="s1">&#39;:message:&#39;</span>
  348. </pre></div>
  349. </div>
  350. <dl class="method">
  351. <dt id="stringtools.stp.stp.process">
  352. <code class="descname">process</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.stp.stp.process" title="Permalink to this definition">¶</a></dt>
  353. <dd><p>This processes a byte out of a “stp-stream”.</p>
  354. <table class="docutils field-list" frame="void" rules="none">
  355. <col class="field-name" />
  356. <col class="field-body" />
  357. <tbody valign="top">
  358. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> (<em>bytes</em>) – A byte stream</td>
  359. </tr>
  360. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The extracted message or None, if no message is identified yet</td>
  361. </tr>
  362. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
  363. </tr>
  364. </tbody>
  365. </table>
  366. </dd></dl>
  367. </dd></dl>
  368. </div>
  369. <div class="toctree-wrapper compound">
  370. </div>
  371. </div>
  372. <div class="section" id="indices-and-tables">
  373. <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
  374. <ul class="simple">
  375. <li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
  376. <li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
  377. <li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
  378. </ul>
  379. </div>
  380. </div>
  381. </div>
  382. </div>
  383. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  384. <div class="sphinxsidebarwrapper"><div class="relations">
  385. <h3>Related Topics</h3>
  386. <ul>
  387. <li><a href="#">Documentation overview</a><ul>
  388. </ul></li>
  389. </ul>
  390. </div>
  391. <div id="searchbox" style="display: none" role="search">
  392. <h3>Quick search</h3>
  393. <form class="search" action="search.html" method="get">
  394. <div><input type="text" name="q" /></div>
  395. <div><input type="submit" value="Go" /></div>
  396. <input type="hidden" name="check_keywords" value="yes" />
  397. <input type="hidden" name="area" value="default" />
  398. </form>
  399. </div>
  400. <script type="text/javascript">$('#searchbox').show(0);</script>
  401. </div>
  402. </div>
  403. <div class="clearer"></div>
  404. </div>
  405. <div class="footer">
  406. &copy;2019, Dirk Alders.
  407. |
  408. Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
  409. &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
  410. |
  411. <a href="_sources/index.rst.txt"
  412. rel="nofollow">Page source</a>
  413. </div>
  414. </body>
  415. </html>