Browse Source

Module documentation update

master
Dirk Alders 4 years ago
parent
commit
f5453861f6

+ 6
- 6
__init__.py View File

@@ -125,11 +125,11 @@ def gzip_compress(s, compresslevel=9):
125 125
 
126 126
     **Example:**
127 127
 
128
-    .. literalinclude:: ../examples/gzip_compress.py
128
+    .. literalinclude:: stringtools/_examples_/gzip_compress.py
129 129
 
130 130
     Will result to the following output:
131 131
 
132
-    .. literalinclude:: ../examples/gzip_compress.log
132
+    .. literalinclude:: stringtools/_examples_/gzip_compress.log
133 133
     """
134 134
     rv = None
135 135
     t = time.time()
@@ -159,11 +159,11 @@ def gzip_extract(s):
159 159
 
160 160
     **Example:**
161 161
 
162
-    .. literalinclude:: ../examples/gzip_extract.py
162
+    .. literalinclude:: stringtools/_examples_/gzip_extract.py
163 163
 
164 164
     Will result to the following output:
165 165
 
166
-    .. literalinclude:: ../examples/gzip_extract.log
166
+    .. literalinclude:: stringtools/_examples_/gzip_extract.log
167 167
     """
168 168
     t = time.time()
169 169
     rv = None
@@ -191,11 +191,11 @@ def hexlify(s):
191 191
 
192 192
     **Example:**
193 193
 
194
-    .. literalinclude:: ../examples/hexlify.py
194
+    .. literalinclude:: stringtools/_examples_/hexlify.py
195 195
 
196 196
     Will result to the following output:
197 197
 
198
-    .. literalinclude:: ../examples/hexlify.log
198
+    .. literalinclude:: stringtools/_examples_/hexlify.log
199 199
     """
200 200
     rv = '(%d):' % len(s)
201 201
     for byte in s:

+ 58
- 39
_docs_/index.html View File

@@ -84,8 +84,8 @@
84 84
               <div class="local-toc"><ul>
85 85
 <li><a class="reference internal" href="#">Welcome to stringtools’s documentation!</a><ul>
86 86
 <li><a class="reference internal" href="#stringtools-stringtools">stringtools (Stringtools)</a></li>
87
-<li><a class="reference internal" href="#csp-carriage-return-seperation-protocol">csp (Carriage-Return seperation protocol)</a></li>
88
-<li><a class="reference internal" href="#stp-serial-transfer-protocol">stp (Serial transfer protocol)</a></li>
87
+<li><a class="reference internal" href="#stringtools-csp-carriage-return-seperation-protocol">stringtools.csp (Carriage-Return seperation protocol)</a></li>
88
+<li><a class="reference internal" href="#stringtools-stp-serial-transfer-protocol">stringtools.stp (Serial transfer protocol)</a></li>
89 89
 </ul>
90 90
 </li>
91 91
 <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
@@ -200,17 +200,19 @@
200 200
 </tbody>
201 201
 </table>
202 202
 <p><strong>Example:</strong></p>
203
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
204
-<span class="kn">import</span> <span class="nn">report</span>
203
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
204
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
205 205
 
206
+<span class="kn">import</span> <span class="nn">stringtools</span>
207
+<span class="kn">import</span> <span class="nn">report</span>
206 208
 
207
-<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
209
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
208 210
 <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>
209 211
 </pre></div>
210 212
 </div>
211 213
 <p>Will result to the following output:</p>
212
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">45</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">558</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">GZIP</span><span class="p">:</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>
213
-<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">64</span> <span class="mi">9</span><span class="n">d</span> <span class="mi">30</span> <span class="mi">5</span><span class="n">e</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>
214
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">305</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">stringtools</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">GZIP</span><span class="p">:</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>
215
+<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">98</span> <span class="mi">21</span> <span class="n">f2</span> <span class="mi">5</span><span class="n">f</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>
214 216
 </pre></div>
215 217
 </div>
216 218
 </dd></dl>
@@ -232,16 +234,18 @@
232 234
 </tbody>
233 235
 </table>
234 236
 <p><strong>Example:</strong></p>
235
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
236
-<span class="kn">import</span> <span class="nn">report</span>
237
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
238
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
237 239
 
240
+<span class="kn">import</span> <span class="nn">stringtools</span>
241
+<span class="kn">import</span> <span class="nn">report</span>
238 242
 
239
-<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
243
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
240 244
 <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>
241 245
 </pre></div>
242 246
 </div>
243 247
 <p>Will result to the following output:</p>
244
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">45</span><span class="p">:</span><span class="mi">39</span><span class="p">,</span><span class="mi">899</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">GZIP</span><span class="p">:</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>
248
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">210</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">stringtools</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">GZIP</span><span class="p">:</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>
245 249
 <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>
246 250
 </pre></div>
247 251
 </div>
@@ -264,8 +268,10 @@
264 268
 </tbody>
265 269
 </table>
266 270
 <p><strong>Example:</strong></p>
267
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
271
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
272
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
268 273
 
274
+<span class="kn">import</span> <span class="nn">stringtools</span>
269 275
 
270 276
 <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>
271 277
 </pre></div>
@@ -277,8 +283,8 @@
277 283
 </dd></dl>
278 284
 
279 285
 </div>
280
-<span class="target" id="module-stringtools.csp"></span><div class="section" id="csp-carriage-return-seperation-protocol">
281
-<h2>csp (Carriage-Return seperation protocol)<a class="headerlink" href="#csp-carriage-return-seperation-protocol" title="Permalink to this headline">¶</a></h2>
286
+<span class="target" id="module-stringtools.csp"></span><div class="section" id="stringtools-csp-carriage-return-seperation-protocol">
287
+<h2>stringtools.csp (Carriage-Return seperation protocol)<a class="headerlink" href="#stringtools-csp-carriage-return-seperation-protocol" title="Permalink to this headline">¶</a></h2>
282 288
 <p><strong>Author:</strong></p>
283 289
 <ul class="simple">
284 290
 <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>
@@ -308,7 +314,10 @@
308 314
 </tbody>
309 315
 </table>
310 316
 <p><strong>Example:</strong></p>
311
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
317
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
318
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
319
+
320
+<span class="kn">import</span> <span class="nn">stringtools</span>
312 321
 
313 322
 <span class="n">data</span> <span class="o">=</span> <span class="sa">b</span><span class="s1">&#39;message&#39;</span>
314 323
 <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>
@@ -328,10 +337,13 @@
328 337
 <em class="property">class </em><code class="descclassname">stringtools.csp.</code><code class="descname">csp</code><span class="sig-paren">(</span><em>seperator=b'n'</em><span class="sig-paren">)</span><a class="headerlink" href="#stringtools.csp.csp" title="Permalink to this definition">¶</a></dt>
329 338
 <dd><p>This class extracts messages from an “csp-stream”.</p>
330 339
 <p><strong>Example:</strong></p>
331
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">report</span>
340
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
341
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
342
+
343
+<span class="kn">import</span> <span class="nn">report</span>
332 344
 <span class="kn">import</span> <span class="nn">stringtools</span>
333 345
 
334
-<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
346
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
335 347
 <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>
336 348
 <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>
337 349
     <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="nb">bytes</span><span class="p">([</span><span class="n">byte</span><span class="p">]))</span>
@@ -340,14 +352,15 @@
340 352
 </pre></div>
341 353
 </div>
342 354
 <p>Will result to the following output:</p>
343
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">093</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">5</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
344
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">094</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">10</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
345
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">094</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">15</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
346
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">095</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">20</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
347
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">095</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">25</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">61</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
348
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">095</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">30</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">61</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">67</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
349
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">096</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">35</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">61</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">67</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
350
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">31</span><span class="p">:</span><span class="mi">22</span><span class="p">,</span><span class="mi">096</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">41</span><span class="p">):</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">73</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">61</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">67</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">65</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span> <span class="mi">5</span><span class="n">b</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">c</span> <span class="mi">6</span><span class="n">e</span> <span class="mi">27</span> <span class="mi">5</span><span class="n">d</span>
355
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">6</span><span class="n">d</span>
356
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">6</span><span class="n">d</span> <span class="mi">65</span>
357
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">3</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>
358
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">4</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>
359
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">5</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>
360
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</span> <span class="p">(</span><span class="mi">6</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>
361
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">CSP</span><span class="p">:</span> <span class="n">Leaving</span> <span class="n">data</span> <span class="ow">in</span> <span class="n">buffer</span> <span class="p">(</span><span class="n">to</span> <span class="n">be</span> <span class="n">processed</span> <span class="nb">next</span> <span class="n">time</span><span class="p">):</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>
362
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">362</span><span class="p">:</span> <span class="n">root</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">INFO</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="o">-</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>
363
+<span class="p">[</span><span class="sa">b</span><span class="s1">&#39;message&#39;</span><span class="p">]</span>
351 364
 </pre></div>
352 365
 </div>
353 366
 <dl class="method">
@@ -371,8 +384,8 @@
371 384
 </dd></dl>
372 385
 
373 386
 </div>
374
-<span class="target" id="module-stringtools.stp"></span><div class="section" id="stp-serial-transfer-protocol">
375
-<h2>stp (Serial transfer protocol)<a class="headerlink" href="#stp-serial-transfer-protocol" title="Permalink to this headline">¶</a></h2>
387
+<span class="target" id="module-stringtools.stp"></span><div class="section" id="stringtools-stp-serial-transfer-protocol">
388
+<h2>stringtools.stp (Serial transfer protocol)<a class="headerlink" href="#stringtools-stp-serial-transfer-protocol" title="Permalink to this headline">¶</a></h2>
376 389
 <p><strong>Author:</strong></p>
377 390
 <ul class="simple">
378 391
 <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>
@@ -450,7 +463,10 @@
450 463
 </tbody>
451 464
 </table>
452 465
 <p><strong>Example:</strong></p>
453
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">stringtools</span>
466
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
467
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
468
+
469
+<span class="kn">import</span> <span class="nn">stringtools</span>
454 470
 
455 471
 <span class="nb">print</span><span class="p">(</span><span class="nb">repr</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>
456 472
 </pre></div>
@@ -466,10 +482,13 @@
466 482
 <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>
467 483
 <dd><p>This class extracts messages from an “stp-stream”.</p>
468 484
 <p><strong>Example:</strong></p>
469
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">report</span>
485
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
486
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
487
+
488
+<span class="kn">import</span> <span class="nn">report</span>
470 489
 <span class="kn">import</span> <span class="nn">stringtools</span>
471 490
 
472
-<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="n">stringtools</span><span class="o">.</span><span class="n">logger_name</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
491
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
473 492
 <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>
474 493
 <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>
475 494
     <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="nb">bytes</span><span class="p">([</span><span class="n">byte</span><span class="p">]))</span>
@@ -478,15 +497,15 @@
478 497
 </pre></div>
479 498
 </div>
480 499
 <p>Will result to the following output:</p>
481
-<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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>
482
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">start</span> <span class="n">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
483
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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>
484
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
485
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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>
486
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
487
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</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>
488
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">end</span> <span class="n">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span> <span class="mi">3</span><span class="n">e</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">storing</span> <span class="n">message</span> <span class="ow">and</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>
489
-<span class="mi">2020</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">28</span> <span class="mi">21</span><span class="p">:</span><span class="mi">38</span><span class="p">:</span><span class="mi">27</span><span class="p">,</span><span class="mi">329</span><span class="p">:</span> <span class="n">STRINGTOOLS</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">message</span> <span class="n">identified</span> <span class="o">-</span> <span class="p">(</span><span class="mi">9</span><span class="p">):</span> <span class="mi">3</span><span class="n">a</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">3</span><span class="n">a</span>
500
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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>
501
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">start</span> <span class="n">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
502
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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>
503
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
504
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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>
505
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</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>
506
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">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>
507
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">DEBUG</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">end</span> <span class="n">pattern</span> <span class="p">(</span><span class="mi">3</span><span class="n">a</span> <span class="mi">3</span><span class="n">e</span><span class="p">)</span> <span class="n">received</span> <span class="o">=&gt;</span> <span class="n">storing</span> <span class="n">message</span> <span class="ow">and</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>
508
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">03</span> <span class="mi">20</span><span class="p">:</span><span class="mi">57</span><span class="p">:</span><span class="mi">12</span><span class="p">,</span><span class="mi">157</span><span class="p">:</span> <span class="n">root</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">INFO</span> <span class="o">-</span> <span class="n">STP</span><span class="p">:</span> <span class="n">message</span> <span class="n">identified</span> <span class="o">-</span> <span class="p">(</span><span class="mi">9</span><span class="p">):</span> <span class="mi">3</span><span class="n">a</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">3</span><span class="n">a</span>
490 509
 <span class="p">[</span><span class="sa">b</span><span class="s1">&#39;:message:&#39;</span><span class="p">]</span>
491 510
 </pre></div>
492 511
 </div>

+ 1
- 1
_docs_/searchindex.js View File

@@ -1 +1 @@
1
-Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{"":{stringtools:[0,0,0,"-"]},"stringtools.csp":{build_frame:[0,1,1,""],csp:[0,2,1,""]},"stringtools.csp.csp":{process:[0,3,1,""]},"stringtools.stp":{DATA_CLEAR_BUFFER:[0,4,1,""],DATA_STORE_SYNC_VALUE:[0,4,1,""],DATA_SYNC:[0,4,1,""],DATA_VALID_MSG:[0,4,1,""],STP_STATE_ESCAPE_1:[0,4,1,""],STP_STATE_ESCAPE_2:[0,4,1,""],STP_STATE_IDLE:[0,4,1,""],STP_STATE_STORE_DATA:[0,4,1,""],build_frame:[0,1,1,""],stp:[0,2,1,""]},"stringtools.stp.stp":{process:[0,3,1,""]},stringtools:{csp:[0,0,0,"-"],gzip_compress:[0,1,1,""],gzip_extract:[0,1,1,""],hexlify:[0,1,1,""],stp:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:data"},terms:{"byte":0,"class":0,"default":0,"function":0,"import":0,"int":0,The:0,Will:0,alder:0,also:0,around:0,author:0,buffer:0,build:0,build_fram:0,bytestream:0,chang:0,charact:0,clear:0,compress:0,compression_r:0,compressionn:0,compresslevel:0,consumed_tim:0,creat:0,data:0,data_clear_buff:0,data_store_sync_valu:0,data_sync:0,data_valid_msg:0,debug:0,definit:0,descript:0,dirk:0,end:0,escap:0,exampl:0,extract:0,finish:0,follow:0,found:0,frame:0,from:0,gzip:0,gzip_compress:0,gzip_extract:0,hexlifi:0,identifi:0,idl:0,includ:0,index:0,info:0,insid:0,interfac:0,leav:0,len:0,level:0,like:0,list:0,log_name_lvl:0,logger_nam:0,messag:0,method:0,mockeri:0,modul:0,mount:0,msg:0,next:0,non:0,none:0,oper:0,option:0,out:0,output:0,page:0,paramet:0,pattern:0,print:0,printabl:0,process:0,receiv:0,report:0,repr:0,result:0,search:0,see:0,sent:0,start:0,state:0,stdoutloggingconfigur:0,store:0,stp_state_escape_1:0,stp_state_escape_2:0,stp_state_idl:0,stp_state_store_data:0,str:0,stream:0,string:0,stringexampl:0,submodul:0,sudo:0,support:0,sync:0,thi:0,time:0,transmit:0,type:0,unittest:0,valid:0,valu:0,via:0,x00:0,x01:0,x02:0,x08:0,x12:0,x1e:0,x1f:0,x2d:0,x3a:0,x3c:0,x3d:0,x3e:0,x40:0,x51:0,x5c:0,x60:0,x63:0,x7d:0,x82:0,x8a:0,x8b:0,xd0:0,xde:0,xe5:0,xff:0,yet:0},titles:["Welcome to stringtools\u2019s documentation!"],titleterms:{"return":0,carriag:0,csp:0,document:0,indic:0,protocol:0,seper:0,serial:0,stp:0,stringtool:0,tabl:0,transfer:0,welcom:0}})
1
+Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{"":{stringtools:[0,0,0,"-"]},"stringtools.csp":{build_frame:[0,1,1,""],csp:[0,2,1,""]},"stringtools.csp.csp":{process:[0,3,1,""]},"stringtools.stp":{DATA_CLEAR_BUFFER:[0,4,1,""],DATA_STORE_SYNC_VALUE:[0,4,1,""],DATA_SYNC:[0,4,1,""],DATA_VALID_MSG:[0,4,1,""],STP_STATE_ESCAPE_1:[0,4,1,""],STP_STATE_ESCAPE_2:[0,4,1,""],STP_STATE_IDLE:[0,4,1,""],STP_STATE_STORE_DATA:[0,4,1,""],build_frame:[0,1,1,""],stp:[0,2,1,""]},"stringtools.stp.stp":{process:[0,3,1,""]},stringtools:{csp:[0,0,0,"-"],gzip_compress:[0,1,1,""],gzip_extract:[0,1,1,""],hexlify:[0,1,1,""],stp:[0,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"],"2":["py","class","Python class"],"3":["py","method","Python method"],"4":["py","data","Python data"]},objtypes:{"0":"py:module","1":"py:function","2":"py:class","3":"py:method","4":"py:data"},terms:{"byte":0,"class":0,"default":0,"function":0,"import":0,"int":0,The:0,Will:0,alder:0,also:0,append:0,around:0,author:0,buffer:0,build:0,build_fram:0,bytestream:0,chang:0,charact:0,clear:0,compress:0,compression_r:0,compressionn:0,compresslevel:0,consumed_tim:0,creat:0,data:0,data_clear_buff:0,data_store_sync_valu:0,data_sync:0,data_valid_msg:0,debug:0,definit:0,descript:0,dirk:0,end:0,escap:0,exampl:0,extract:0,finish:0,follow:0,found:0,frame:0,from:0,gzip:0,gzip_compress:0,gzip_extract:0,hexlifi:0,identifi:0,idl:0,includ:0,index:0,info:0,insid:0,interfac:0,leav:0,len:0,level:0,like:0,list:0,log_name_lvl:0,messag:0,method:0,mockeri:0,modul:0,mount:0,msg:0,next:0,non:0,none:0,oper:0,option:0,out:0,output:0,page:0,paramet:0,path:0,pattern:0,print:0,printabl:0,process:0,receiv:0,report:0,repr:0,result:0,root:0,search:0,see:0,sent:0,start:0,state:0,stdoutloggingconfigur:0,store:0,stp_state_escape_1:0,stp_state_escape_2:0,stp_state_idl:0,stp_state_store_data:0,str:0,stream:0,string:0,stringexampl:0,submodul:0,sudo:0,support:0,sync:0,sys:0,thi:0,time:0,transmit:0,type:0,unittest:0,valid:0,valu:0,via:0,x00:0,x01:0,x02:0,x08:0,x12:0,x1e:0,x1f:0,x2d:0,x3a:0,x3c:0,x3d:0,x3e:0,x40:0,x51:0,x5c:0,x60:0,x63:0,x7d:0,x82:0,x8a:0,x8b:0,xd0:0,xde:0,xe5:0,xff:0,yet:0},titles:["Welcome to stringtools\u2019s documentation!"],titleterms:{"return":0,carriag:0,csp:0,document:0,indic:0,protocol:0,seper:0,serial:0,stp:0,stringtool:0,tabl:0,transfer:0,welcom:0}})

+ 11
- 0
_examples_/Makefile View File

@@ -0,0 +1,11 @@
1
+EXAMPLES = $(wildcard *.py)
2
+LOGFILES = ${EXAMPLES:.py=.log}
3
+
4
+.PHONY: all
5
+all: $(LOGFILES)
6
+
7
+%.log: %.py
8
+	python3 $< > $@
9
+
10
+clean:
11
+	rm $(LOGFILES)

+ 9
- 0
_examples_/csp.build_frame.py View File

@@ -0,0 +1,9 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import stringtools
5
+
6
+data = b'message'
7
+print(stringtools.hexlify(data))
8
+print(stringtools.hexlify(stringtools.csp.build_frame(data)))
9
+

+ 12
- 0
_examples_/csp.csp.py View File

@@ -0,0 +1,12 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import report
5
+import stringtools
6
+
7
+report.stdoutLoggingConfigure(log_name_lvl=[('root', 'DEBUG'), ])
8
+s = stringtools.csp.csp()
9
+for byte in b'message\n':
10
+    data = s.process(bytes([byte]))
11
+    if len(data) > 0:
12
+        print(data)

+ 8
- 0
_examples_/gzip_compress.py View File

@@ -0,0 +1,8 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import stringtools
5
+import report
6
+
7
+report.stdoutLoggingConfigure(log_name_lvl=[('root', 'DEBUG'), ])
8
+print(stringtools.hexlify(stringtools.gzip_compress(15 * b'\x00' + 15 * b'\xff')))

+ 8
- 0
_examples_/gzip_extract.py View File

@@ -0,0 +1,8 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import stringtools
5
+import report
6
+
7
+report.stdoutLoggingConfigure(log_name_lvl=[('root', 'DEBUG'), ])
8
+print(stringtools.hexlify(stringtools.gzip_extract(b'\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')))

+ 6
- 0
_examples_/hexlify.py View File

@@ -0,0 +1,6 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import stringtools
5
+
6
+print(stringtools.hexlify(b'A stringexample with non printable characters like \x12'))

+ 6
- 0
_examples_/stp.build_frame.py View File

@@ -0,0 +1,6 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import stringtools
5
+
6
+print(repr(stringtools.stp.build_frame(b':message:')))

+ 12
- 0
_examples_/stp.stp.py View File

@@ -0,0 +1,12 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import report
5
+import stringtools
6
+
7
+report.stdoutLoggingConfigure(log_name_lvl=[('root', 'DEBUG'), ])
8
+s = stringtools.stp.stp()
9
+for byte in b':<:=message:=:>':
10
+    data = s.process(bytes([byte]))
11
+    if len(data) > 0:
12
+        print(data)

+ 6
- 6
csp.py View File

@@ -2,8 +2,8 @@
2 2
 # -*- coding: utf-8 -*-
3 3
 #
4 4
 """
5
-csp (Carriage-Return seperation protocol)
6
-=========================================
5
+stringtools.csp (Carriage-Return seperation protocol)
6
+=====================================================
7 7
 
8 8
 **Author:**
9 9
 
@@ -38,11 +38,11 @@ class csp(object):
38 38
 
39 39
     **Example:**
40 40
 
41
-    .. literalinclude:: ../examples/csp.csp.py
41
+    .. literalinclude:: stringtools/_examples_/csp.csp.py
42 42
 
43 43
     Will result to the following output:
44 44
 
45
-    .. literalinclude:: ../examples/csp.csp.log
45
+    .. literalinclude:: stringtools/_examples_/csp.csp.log
46 46
     """
47 47
     LOG_PREFIX = 'CSP:'
48 48
 
@@ -80,11 +80,11 @@ def build_frame(msg, seperator=DATA_SEPERATOR):
80 80
 
81 81
     **Example:**
82 82
 
83
-    .. literalinclude:: ../examples/csp.build_frame.py
83
+    .. literalinclude:: stringtools/_examples_/csp.build_frame.py
84 84
 
85 85
     Will result to the following output:
86 86
 
87
-    .. literalinclude:: ../examples/csp.build_frame.log
87
+    .. literalinclude:: stringtools/_examples_/csp.build_frame.log
88 88
     """
89 89
     if seperator in msg:
90 90
         raise ValueError

+ 6
- 6
stp.py View File

@@ -2,8 +2,8 @@
2 2
 # -*- coding: utf-8 -*-
3 3
 #
4 4
 """
5
-stp (Serial transfer protocol)
6
-==============================
5
+stringtools.stp (Serial transfer protocol)
6
+==========================================
7 7
 
8 8
 **Author:**
9 9
 
@@ -54,11 +54,11 @@ class stp(object):
54 54
 
55 55
     **Example:**
56 56
 
57
-    .. literalinclude:: ../examples/stp.stp.py
57
+    .. literalinclude:: stringtools/_examples_/stp.stp.py
58 58
 
59 59
     Will result to the following output:
60 60
 
61
-    .. literalinclude:: ../examples/stp.stp.log
61
+    .. literalinclude:: stringtools/_examples_/stp.stp.log
62 62
     """
63 63
     LOG_PREFIX = 'STP:'
64 64
 
@@ -158,11 +158,11 @@ def build_frame(data):
158 158
 
159 159
     **Example:**
160 160
 
161
-    .. literalinclude:: ../examples/stp.build_frame.py
161
+    .. literalinclude:: stringtools/_examples_/stp.build_frame.py
162 162
 
163 163
     Will result to the following output:
164 164
 
165
-    .. literalinclude:: ../examples/stp.build_frame.log
165
+    .. literalinclude:: stringtools/_examples_/stp.build_frame.log
166 166
     """
167 167
     rv = DATA_SYNC + DATA_CLEAR_BUFFER
168 168
 

Loading…
Cancel
Save