Dirk Alders 4 yıl önce
ebeveyn
işleme
b86248c1a3

+ 161
- 0
__init__.py Dosyayı Görüntüle

@@ -0,0 +1,161 @@
1
+#!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+#
4
+"""
5
+stringtools (Stringtools)
6
+=========================
7
+
8
+**Author:**
9
+
10
+* Dirk Alders <sudo-dirk@mount-mockery.de>
11
+
12
+**Description:**
13
+
14
+    This Module supports functionality around string operations.
15
+
16
+**Submodules:**
17
+
18
+* :mod:`stringtools.csp`
19
+* :mod:`stringtools.stp`
20
+* :func:`gzip_compress`
21
+* :func:`gzip_extract`
22
+* :func:`hexlify`
23
+
24
+**Unittest:**
25
+
26
+        See also the :download:`unittest <stringtools/_testresults_/unittest.pdf>` documentation.
27
+
28
+**Module Documentation:**
29
+
30
+"""
31
+
32
+from stringtools import stp
33
+from stringtools import csp
34
+__DEPENDENCIES__ = []
35
+
36
+import gzip
37
+import logging
38
+import time
39
+import sys
40
+if sys.version_info < (3, 0):
41
+    from cStringIO import StringIO
42
+
43
+logger_name = 'STRINGTOOLS'
44
+logger = logging.getLogger(logger_name)
45
+
46
+__DESCRIPTION__ = """The Module {\\tt %s} is designed to support functionality for strings (e.g. transfer strings via a bytestream, compressing, extracting, ...).
47
+For more Information read the sphinx documentation.""" % __name__.replace('_', '\_')
48
+"""The Module Description"""
49
+__INTERPRETER__ = (2, 3)
50
+"""The Tested Interpreter-Versions"""
51
+
52
+__all__ = ['gzip_compress',
53
+           'gzip_extract',
54
+           'hexlify',
55
+           'csp',
56
+           'stp']
57
+
58
+
59
+def gzip_compress(s, compresslevel=9):
60
+    """
61
+    Method to compress a stream of bytes.
62
+
63
+    :param str s: The bytestream (string) to be compressed
64
+    :param int compresslevel: An optional compressionn level (default is 9)
65
+    :return: The compressed bytestream
66
+    :rtype: str
67
+
68
+    **Example:**
69
+
70
+    .. literalinclude:: ../examples/gzip_compress.py
71
+
72
+    Will result to the following output:
73
+
74
+    .. literalinclude:: ../examples/gzip_compress.log
75
+    """
76
+    rv = None
77
+    t = time.time()
78
+    if sys.version_info >= (3, 0):
79
+        rv = gzip.compress(s, compresslevel)
80
+    else:
81
+        buf = StringIO()
82
+        f = gzip.GzipFile(mode='wb', compresslevel=compresslevel, fileobj=buf)
83
+        try:
84
+            f.write(s)
85
+        finally:
86
+            f.close()
87
+            rv = buf.getvalue()
88
+            buf.close()
89
+    if rv is not None:
90
+        logger.debug('GZIP: Finished to compress a string (compression_rate=%.3f, consumed_time=%.1fs).', len(rv) / float(len(s)), time.time() - t)
91
+    return rv
92
+
93
+
94
+def gzip_extract(s):
95
+    """
96
+    Method to extract data from a compress stream of bytes.
97
+
98
+    :param str s: The compressed bytestream (string) to be extracted
99
+    :return: The extracted data
100
+    :rtype: str
101
+
102
+    **Example:**
103
+
104
+    .. literalinclude:: ../examples/gzip_extract.py
105
+
106
+    Will result to the following output:
107
+
108
+    .. literalinclude:: ../examples/gzip_extract.log
109
+    """
110
+    t = time.time()
111
+    rv = None
112
+    if sys.version_info >= (3, 0):
113
+        rv = gzip.decompress(s)
114
+    else:
115
+        inbuffer = StringIO(s)
116
+        f = gzip.GzipFile(mode='rb', fileobj=inbuffer)
117
+        try:
118
+            rv = f.read()
119
+        finally:
120
+            f.close()
121
+            inbuffer.close()
122
+    if rv is not None:
123
+        logger.debug('GZIP: Finished to extract a string (compression_rate=%.3f, consumed_time=%.1fs).', len(s) / float(len(rv)), time.time() - t)
124
+    return rv
125
+
126
+
127
+def hexlify(s):
128
+    """Method to hexlify a string.
129
+
130
+    :param str s: A string including the bytes to be hexlified.
131
+    :returns: The hexlified string
132
+    :rtype: str
133
+
134
+    **Example:**
135
+
136
+    .. literalinclude:: ../examples/hexlify.py
137
+
138
+    Will result to the following output:
139
+
140
+    .. literalinclude:: ../examples/hexlify.log
141
+    """
142
+    rv = '(%d):' % len(s)
143
+    for byte in s:
144
+        if sys.version_info >= (3, 0):
145
+            rv += ' %02x' % byte
146
+        else:
147
+            rv += ' %02x' % ord(byte)
148
+    return rv
149
+
150
+
151
+def linefeed_filter(s):
152
+    """Method to change linefeed and carriage return to '\\\\n' and '\\\\r'
153
+
154
+    :param str s: A string including carriage return and/ or linefeed.
155
+    :returns: A string with converted carriage return and/ or linefeed.
156
+    :rtype: str
157
+    """
158
+    if sys.version_info >= (3, 0):
159
+        return s.replace(b'\r', b'\\r').replace(b'\n', b'\\n')
160
+    else:
161
+        return s.replace('\r', '\\r').replace('\n', '\\n')

+ 4
- 0
_docs_/.buildinfo Dosyayı Görüntüle

@@ -0,0 +1,4 @@
1
+# Sphinx build info version 1
2
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3
+config: 37119bbe4e61a9df7390cce354ca5758
4
+tags: 645f666f9bcd5a90fca523b33c5a78b7

BIN
_docs_/_downloads/ff52811ec541013fb25b89de3139897b/unittest.pdf Dosyayı Görüntüle


BIN
_docs_/_downloads/unittest.pdf Dosyayı Görüntüle


+ 27
- 0
_docs_/_sources/index.rst.txt Dosyayı Görüntüle

@@ -0,0 +1,27 @@
1
+.. stringtools documentation master file, created by
2
+   sphinx-quickstart on Fri May 17 07:22:59 2019.
3
+   You can adapt this file completely to your liking, but it should at least
4
+   contain the root `toctree` directive.
5
+
6
+Welcome to stringtools's documentation!
7
+=======================================
8
+
9
+.. automodule:: stringtools
10
+   :members:
11
+.. automodule:: stringtools.csp
12
+   :members:
13
+.. automodule:: stringtools.stp
14
+   :members:
15
+
16
+.. toctree::
17
+   :maxdepth: 2
18
+   :caption: Contents:
19
+
20
+
21
+
22
+Indices and tables
23
+==================
24
+
25
+* :ref:`genindex`
26
+* :ref:`modindex`
27
+* :ref:`search`

BIN
_docs_/_static/ajax-loader.gif Dosyayı Görüntüle


+ 607
- 0
_docs_/_static/alabaster.css Dosyayı Görüntüle

@@ -0,0 +1,607 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+@import url("basic.css");
19
+
20
+/* -- page layout ----------------------------------------------------------- */
21
+
22
+body {
23
+    font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
24
+    font-size: 17px;
25
+    background-color: white;
26
+    color: #000;
27
+    margin: 0;
28
+    padding: 0;
29
+}
30
+
31
+
32
+div.document {
33
+    width: auto;
34
+    margin: 30px auto 0 auto;
35
+}
36
+
37
+div.documentwrapper {
38
+    float: left;
39
+    width: 100%;
40
+}
41
+
42
+div.bodywrapper {
43
+    margin: 0 0 0 220px;
44
+}
45
+
46
+div.sphinxsidebar {
47
+    width: 220px;
48
+    font-size: 14px;
49
+    line-height: 1.5;
50
+}
51
+
52
+hr {
53
+    border: 1px solid #B1B4B6;
54
+}
55
+
56
+div.body {
57
+    background-color: #ffffff;
58
+    color: #3E4349;
59
+    padding: 0 30px 0 30px;
60
+}
61
+
62
+div.body > .section {
63
+    text-align: left;
64
+}
65
+
66
+div.footer {
67
+    width: auto;
68
+    margin: 20px auto 30px auto;
69
+    font-size: 14px;
70
+    color: #888;
71
+    text-align: right;
72
+}
73
+
74
+div.footer a {
75
+    color: #888;
76
+}
77
+
78
+p.caption {
79
+    font-family: ;
80
+    font-size: inherit;
81
+}
82
+
83
+
84
+div.relations {
85
+    display: none;
86
+}
87
+
88
+
89
+div.sphinxsidebar a {
90
+    color: #444;
91
+    text-decoration: none;
92
+    border-bottom: 1px dotted #999;
93
+}
94
+
95
+div.sphinxsidebar a:hover {
96
+    border-bottom: 1px solid #999;
97
+}
98
+
99
+div.sphinxsidebarwrapper {
100
+    padding: 18px 10px;
101
+}
102
+
103
+div.sphinxsidebarwrapper p.logo {
104
+    padding: 0;
105
+    margin: -10px 0 0 0px;
106
+    text-align: center;
107
+}
108
+
109
+div.sphinxsidebarwrapper h1.logo {
110
+    margin-top: -10px;
111
+    text-align: center;
112
+    margin-bottom: 5px;
113
+    text-align: left;
114
+}
115
+
116
+div.sphinxsidebarwrapper h1.logo-name {
117
+    margin-top: 0px;
118
+}
119
+
120
+div.sphinxsidebarwrapper p.blurb {
121
+    margin-top: 0;
122
+    font-style: normal;
123
+}
124
+
125
+div.sphinxsidebar h3,
126
+div.sphinxsidebar h4 {
127
+    font-family: 'Garamond', 'Georgia', serif;
128
+    color: #444;
129
+    font-size: 24px;
130
+    font-weight: normal;
131
+    margin: 0 0 5px 0;
132
+    padding: 0;
133
+}
134
+
135
+div.sphinxsidebar h4 {
136
+    font-size: 20px;
137
+}
138
+
139
+div.sphinxsidebar h3 a {
140
+    color: #444;
141
+}
142
+
143
+div.sphinxsidebar p.logo a,
144
+div.sphinxsidebar h3 a,
145
+div.sphinxsidebar p.logo a:hover,
146
+div.sphinxsidebar h3 a:hover {
147
+    border: none;
148
+}
149
+
150
+div.sphinxsidebar p {
151
+    color: #555;
152
+    margin: 10px 0;
153
+}
154
+
155
+div.sphinxsidebar ul {
156
+    margin: 10px 0;
157
+    padding: 0;
158
+    color: #000;
159
+}
160
+
161
+div.sphinxsidebar ul li.toctree-l1 > a {
162
+    font-size: 120%;
163
+}
164
+
165
+div.sphinxsidebar ul li.toctree-l2 > a {
166
+    font-size: 110%;
167
+}
168
+
169
+div.sphinxsidebar input {
170
+    border: 1px solid #CCC;
171
+    font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
172
+    font-size: 1em;
173
+}
174
+
175
+div.sphinxsidebar hr {
176
+    border: none;
177
+    height: 1px;
178
+    color: #AAA;
179
+    background: #AAA;
180
+
181
+    text-align: left;
182
+    margin-left: 0;
183
+    width: 50%;
184
+}
185
+
186
+/* -- body styles ----------------------------------------------------------- */
187
+
188
+a {
189
+    color: #004B6B;
190
+    text-decoration: underline;
191
+}
192
+
193
+a:hover {
194
+    color: #6D4100;
195
+    text-decoration: underline;
196
+}
197
+
198
+div.body h1,
199
+div.body h2,
200
+div.body h3,
201
+div.body h4,
202
+div.body h5,
203
+div.body h6 {
204
+    font-family: 'Garamond', 'Georgia', serif;
205
+    font-weight: normal;
206
+    margin: 30px 0px 10px 0px;
207
+    padding: 0;
208
+}
209
+
210
+div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
211
+div.body h2 { font-size: 180%; }
212
+div.body h3 { font-size: 150%; }
213
+div.body h4 { font-size: 130%; }
214
+div.body h5 { font-size: 100%; }
215
+div.body h6 { font-size: 100%; }
216
+
217
+a.headerlink {
218
+    color: #DDD;
219
+    padding: 0 4px;
220
+    text-decoration: none;
221
+}
222
+
223
+a.headerlink:hover {
224
+    color: #444;
225
+    background: #EAEAEA;
226
+}
227
+
228
+div.body p, div.body dd, div.body li {
229
+    line-height: 1.4em;
230
+}
231
+
232
+div.admonition {
233
+    margin: 20px 0px;
234
+    padding: 10px 30px;
235
+    background-color: #FCC;
236
+    border: 1px solid #FAA;
237
+}
238
+
239
+div.admonition tt.xref, div.admonition a tt {
240
+    border-bottom: 1px solid #fafafa;
241
+}
242
+
243
+dd div.admonition {
244
+    margin-left: -60px;
245
+    padding-left: 60px;
246
+}
247
+
248
+div.admonition p.admonition-title {
249
+    font-family: 'Garamond', 'Georgia', serif;
250
+    font-weight: normal;
251
+    font-size: 24px;
252
+    margin: 0 0 10px 0;
253
+    padding: 0;
254
+    line-height: 1;
255
+}
256
+
257
+div.admonition p.last {
258
+    margin-bottom: 0;
259
+}
260
+
261
+div.highlight {
262
+    background-color: white;
263
+}
264
+
265
+dt:target, .highlight {
266
+    background: #FAF3E8;
267
+}
268
+
269
+div.note {
270
+    background-color: #EEE;
271
+    border: 1px solid #CCC;
272
+}
273
+
274
+div.seealso {
275
+    background-color: #EEE;
276
+    border: 1px solid #CCC;
277
+}
278
+
279
+div.topic {
280
+    background-color: #eee;
281
+}
282
+
283
+p.admonition-title {
284
+    display: inline;
285
+}
286
+
287
+p.admonition-title:after {
288
+    content: ":";
289
+}
290
+
291
+pre, tt, code {
292
+    font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
293
+    font-size: 0.9em;
294
+}
295
+
296
+.hll {
297
+    background-color: #FFC;
298
+    margin: 0 -12px;
299
+    padding: 0 12px;
300
+    display: block;
301
+}
302
+
303
+img.screenshot {
304
+}
305
+
306
+tt.descname, tt.descclassname, code.descname, code.descclassname {
307
+    font-size: 0.95em;
308
+}
309
+
310
+tt.descname, code.descname {
311
+    padding-right: 0.08em;
312
+}
313
+
314
+img.screenshot {
315
+    -moz-box-shadow: 2px 2px 4px #eee;
316
+    -webkit-box-shadow: 2px 2px 4px #eee;
317
+    box-shadow: 2px 2px 4px #eee;
318
+}
319
+
320
+table.docutils {
321
+    border: 1px solid #888;
322
+    -moz-box-shadow: 2px 2px 4px #eee;
323
+    -webkit-box-shadow: 2px 2px 4px #eee;
324
+    box-shadow: 2px 2px 4px #eee;
325
+}
326
+
327
+table.docutils td, table.docutils th {
328
+    border: 1px solid #888;
329
+    padding: 0.25em 0.7em;
330
+}
331
+
332
+table.field-list, table.footnote {
333
+    border: none;
334
+    -moz-box-shadow: none;
335
+    -webkit-box-shadow: none;
336
+    box-shadow: none;
337
+}
338
+
339
+table.footnote {
340
+    margin: 15px 0;
341
+    width: 100%;
342
+    border: 1px solid #EEE;
343
+    background: #FDFDFD;
344
+    font-size: 0.9em;
345
+}
346
+
347
+table.footnote + table.footnote {
348
+    margin-top: -15px;
349
+    border-top: none;
350
+}
351
+
352
+table.field-list th {
353
+    padding: 0 0.8em 0 0;
354
+}
355
+
356
+table.field-list td {
357
+    padding: 0;
358
+}
359
+
360
+table.field-list p {
361
+    margin-bottom: 0.8em;
362
+}
363
+
364
+table.footnote td.label {
365
+    width: .1px;
366
+    padding: 0.3em 0 0.3em 0.5em;
367
+}
368
+
369
+table.footnote td {
370
+    padding: 0.3em 0.5em;
371
+}
372
+
373
+dl {
374
+    margin: 0;
375
+    padding: 0;
376
+}
377
+
378
+dl dd {
379
+    margin-left: 30px;
380
+}
381
+
382
+blockquote {
383
+    margin: 0 0 0 30px;
384
+    padding: 0;
385
+}
386
+
387
+ul, ol {
388
+    /* Matches the 30px from the narrow-screen "li > ul" selector below */
389
+    margin: 10px 0 10px 30px;
390
+    padding: 0;
391
+}
392
+
393
+pre {
394
+    background: #EEE;
395
+    padding: 7px 30px;
396
+    margin: 15px 0px;
397
+    line-height: 1.3em;
398
+}
399
+
400
+dl pre, blockquote pre, li pre {
401
+    margin-left: 0;
402
+    padding-left: 30px;
403
+}
404
+
405
+dl dl pre {
406
+    margin-left: -90px;
407
+    padding-left: 90px;
408
+}
409
+
410
+tt, code {
411
+    background-color: #ecf0f3;
412
+    color: #222;
413
+    /* padding: 1px 2px; */
414
+}
415
+
416
+tt.xref, code.xref, a tt {
417
+    background-color: #FBFBFB;
418
+    border-bottom: 1px solid white;
419
+}
420
+
421
+a.reference {
422
+    text-decoration: none;
423
+    border-bottom: 1px dotted #004B6B;
424
+}
425
+
426
+/* Don't put an underline on images */
427
+a.image-reference, a.image-reference:hover {
428
+    border-bottom: none;
429
+}
430
+
431
+a.reference:hover {
432
+    border-bottom: 1px solid #6D4100;
433
+}
434
+
435
+a.footnote-reference {
436
+    text-decoration: none;
437
+    font-size: 0.7em;
438
+    vertical-align: top;
439
+    border-bottom: 1px dotted #004B6B;
440
+}
441
+
442
+a.footnote-reference:hover {
443
+    border-bottom: 1px solid #6D4100;
444
+}
445
+
446
+a:hover tt, a:hover code {
447
+    background: #EEE;
448
+}
449
+
450
+
451
+@media screen and (max-width: 870px) {
452
+
453
+    div.sphinxsidebar {
454
+    	display: none;
455
+    }
456
+
457
+    div.document {
458
+       width: 100%;
459
+
460
+    }
461
+
462
+    div.documentwrapper {
463
+    	margin-left: 0;
464
+    	margin-top: 0;
465
+    	margin-right: 0;
466
+    	margin-bottom: 0;
467
+    }
468
+
469
+    div.bodywrapper {
470
+    	margin-top: 0;
471
+    	margin-right: 0;
472
+    	margin-bottom: 0;
473
+    	margin-left: 0;
474
+    }
475
+
476
+    ul {
477
+    	margin-left: 0;
478
+    }
479
+
480
+	li > ul {
481
+        /* Matches the 30px from the "ul, ol" selector above */
482
+		margin-left: 30px;
483
+	}
484
+
485
+    .document {
486
+    	width: auto;
487
+    }
488
+
489
+    .footer {
490
+    	width: auto;
491
+    }
492
+
493
+    .bodywrapper {
494
+    	margin: 0;
495
+    }
496
+
497
+    .footer {
498
+    	width: auto;
499
+    }
500
+
501
+    .github {
502
+        display: none;
503
+    }
504
+
505
+
506
+
507
+}
508
+
509
+
510
+
511
+@media screen and (max-width: 875px) {
512
+
513
+    body {
514
+        margin: 0;
515
+        padding: 20px 30px;
516
+    }
517
+
518
+    div.documentwrapper {
519
+        float: none;
520
+        background: white;
521
+    }
522
+
523
+    div.sphinxsidebar {
524
+        display: block;
525
+        float: none;
526
+        width: 102.5%;
527
+        margin: 50px -30px -20px -30px;
528
+        padding: 10px 20px;
529
+        background: #333;
530
+        color: #FFF;
531
+    }
532
+
533
+    div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
534
+    div.sphinxsidebar h3 a {
535
+        color: white;
536
+    }
537
+
538
+    div.sphinxsidebar a {
539
+        color: #AAA;
540
+    }
541
+
542
+    div.sphinxsidebar p.logo {
543
+        display: none;
544
+    }
545
+
546
+    div.document {
547
+        width: 100%;
548
+        margin: 0;
549
+    }
550
+
551
+    div.footer {
552
+        display: none;
553
+    }
554
+
555
+    div.bodywrapper {
556
+        margin: 0;
557
+    }
558
+
559
+    div.body {
560
+        min-height: 0;
561
+        padding: 0;
562
+    }
563
+
564
+    .rtd_doc_footer {
565
+        display: none;
566
+    }
567
+
568
+    .document {
569
+        width: auto;
570
+    }
571
+
572
+    .footer {
573
+        width: auto;
574
+    }
575
+
576
+    .footer {
577
+        width: auto;
578
+    }
579
+
580
+    .github {
581
+        display: none;
582
+    }
583
+}
584
+
585
+
586
+/* misc. */
587
+
588
+.revsys-inline {
589
+    display: none!important;
590
+}
591
+
592
+/* Make nested-list/multi-paragraph items look better in Releases changelog
593
+ * pages. Without this, docutils' magical list fuckery causes inconsistent
594
+ * formatting between different release sub-lists.
595
+ */
596
+div#changelog > div.section > ul > li > p:only-child {
597
+    margin-bottom: 0;
598
+}
599
+
600
+/* Hide fugly table cell borders in ..bibliography:: directive output */
601
+table.docutils.citation, table.docutils.citation td, table.docutils.citation th {
602
+  border: none;
603
+  /* Below needed in some edge cases; if not applied, bottom shadows appear */
604
+  -moz-box-shadow: none;
605
+  -webkit-box-shadow: none;
606
+  box-shadow: none;
607
+}

+ 648
- 0
_docs_/_static/basic.css Dosyayı Görüntüle

@@ -0,0 +1,648 @@
1
+/*
2
+ * basic.css
3
+ * ~~~~~~~~~
4
+ *
5
+ * Sphinx stylesheet -- basic theme.
6
+ *
7
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+/* -- main layout ----------------------------------------------------------- */
13
+
14
+div.clearer {
15
+    clear: both;
16
+}
17
+
18
+/* -- relbar ---------------------------------------------------------------- */
19
+
20
+div.related {
21
+    width: 100%;
22
+    font-size: 90%;
23
+}
24
+
25
+div.related h3 {
26
+    display: none;
27
+}
28
+
29
+div.related ul {
30
+    margin: 0;
31
+    padding: 0 0 0 10px;
32
+    list-style: none;
33
+}
34
+
35
+div.related li {
36
+    display: inline;
37
+}
38
+
39
+div.related li.right {
40
+    float: right;
41
+    margin-right: 5px;
42
+}
43
+
44
+/* -- sidebar --------------------------------------------------------------- */
45
+
46
+div.sphinxsidebarwrapper {
47
+    padding: 10px 5px 0 10px;
48
+}
49
+
50
+div.sphinxsidebar {
51
+    float: left;
52
+    width: 230px;
53
+    margin-left: -100%;
54
+    font-size: 90%;
55
+    word-wrap: break-word;
56
+    overflow-wrap : break-word;
57
+}
58
+
59
+div.sphinxsidebar ul {
60
+    list-style: none;
61
+}
62
+
63
+div.sphinxsidebar ul ul,
64
+div.sphinxsidebar ul.want-points {
65
+    margin-left: 20px;
66
+    list-style: square;
67
+}
68
+
69
+div.sphinxsidebar ul ul {
70
+    margin-top: 0;
71
+    margin-bottom: 0;
72
+}
73
+
74
+div.sphinxsidebar form {
75
+    margin-top: 10px;
76
+}
77
+
78
+div.sphinxsidebar input {
79
+    border: 1px solid #98dbcc;
80
+    font-family: sans-serif;
81
+    font-size: 1em;
82
+}
83
+
84
+div.sphinxsidebar #searchbox input[type="text"] {
85
+    width: 170px;
86
+}
87
+
88
+img {
89
+    border: 0;
90
+    max-width: 100%;
91
+}
92
+
93
+/* -- search page ----------------------------------------------------------- */
94
+
95
+ul.search {
96
+    margin: 10px 0 0 20px;
97
+    padding: 0;
98
+}
99
+
100
+ul.search li {
101
+    padding: 5px 0 5px 20px;
102
+    background-image: url(file.png);
103
+    background-repeat: no-repeat;
104
+    background-position: 0 7px;
105
+}
106
+
107
+ul.search li a {
108
+    font-weight: bold;
109
+}
110
+
111
+ul.search li div.context {
112
+    color: #888;
113
+    margin: 2px 0 0 30px;
114
+    text-align: left;
115
+}
116
+
117
+ul.keywordmatches li.goodmatch a {
118
+    font-weight: bold;
119
+}
120
+
121
+/* -- index page ------------------------------------------------------------ */
122
+
123
+table.contentstable {
124
+    width: 90%;
125
+    margin-left: auto;
126
+    margin-right: auto;
127
+}
128
+
129
+table.contentstable p.biglink {
130
+    line-height: 150%;
131
+}
132
+
133
+a.biglink {
134
+    font-size: 1.3em;
135
+}
136
+
137
+span.linkdescr {
138
+    font-style: italic;
139
+    padding-top: 5px;
140
+    font-size: 90%;
141
+}
142
+
143
+/* -- general index --------------------------------------------------------- */
144
+
145
+table.indextable {
146
+    width: 100%;
147
+}
148
+
149
+table.indextable td {
150
+    text-align: left;
151
+    vertical-align: top;
152
+}
153
+
154
+table.indextable ul {
155
+    margin-top: 0;
156
+    margin-bottom: 0;
157
+    list-style-type: none;
158
+}
159
+
160
+table.indextable > tbody > tr > td > ul {
161
+    padding-left: 0em;
162
+}
163
+
164
+table.indextable tr.pcap {
165
+    height: 10px;
166
+}
167
+
168
+table.indextable tr.cap {
169
+    margin-top: 10px;
170
+    background-color: #f2f2f2;
171
+}
172
+
173
+img.toggler {
174
+    margin-right: 3px;
175
+    margin-top: 3px;
176
+    cursor: pointer;
177
+}
178
+
179
+div.modindex-jumpbox {
180
+    border-top: 1px solid #ddd;
181
+    border-bottom: 1px solid #ddd;
182
+    margin: 1em 0 1em 0;
183
+    padding: 0.4em;
184
+}
185
+
186
+div.genindex-jumpbox {
187
+    border-top: 1px solid #ddd;
188
+    border-bottom: 1px solid #ddd;
189
+    margin: 1em 0 1em 0;
190
+    padding: 0.4em;
191
+}
192
+
193
+/* -- domain module index --------------------------------------------------- */
194
+
195
+table.modindextable td {
196
+    padding: 2px;
197
+    border-collapse: collapse;
198
+}
199
+
200
+/* -- general body styles --------------------------------------------------- */
201
+
202
+div.body p, div.body dd, div.body li, div.body blockquote {
203
+    -moz-hyphens: auto;
204
+    -ms-hyphens: auto;
205
+    -webkit-hyphens: auto;
206
+    hyphens: auto;
207
+}
208
+
209
+a.headerlink {
210
+    visibility: hidden;
211
+}
212
+
213
+h1:hover > a.headerlink,
214
+h2:hover > a.headerlink,
215
+h3:hover > a.headerlink,
216
+h4:hover > a.headerlink,
217
+h5:hover > a.headerlink,
218
+h6:hover > a.headerlink,
219
+dt:hover > a.headerlink,
220
+caption:hover > a.headerlink,
221
+p.caption:hover > a.headerlink,
222
+div.code-block-caption:hover > a.headerlink {
223
+    visibility: visible;
224
+}
225
+
226
+div.body p.caption {
227
+    text-align: inherit;
228
+}
229
+
230
+div.body td {
231
+    text-align: left;
232
+}
233
+
234
+.first {
235
+    margin-top: 0 !important;
236
+}
237
+
238
+p.rubric {
239
+    margin-top: 30px;
240
+    font-weight: bold;
241
+}
242
+
243
+img.align-left, .figure.align-left, object.align-left {
244
+    clear: left;
245
+    float: left;
246
+    margin-right: 1em;
247
+}
248
+
249
+img.align-right, .figure.align-right, object.align-right {
250
+    clear: right;
251
+    float: right;
252
+    margin-left: 1em;
253
+}
254
+
255
+img.align-center, .figure.align-center, object.align-center {
256
+  display: block;
257
+  margin-left: auto;
258
+  margin-right: auto;
259
+}
260
+
261
+.align-left {
262
+    text-align: left;
263
+}
264
+
265
+.align-center {
266
+    text-align: center;
267
+}
268
+
269
+.align-right {
270
+    text-align: right;
271
+}
272
+
273
+/* -- sidebars -------------------------------------------------------------- */
274
+
275
+div.sidebar {
276
+    margin: 0 0 0.5em 1em;
277
+    border: 1px solid #ddb;
278
+    padding: 7px 7px 0 7px;
279
+    background-color: #ffe;
280
+    width: 40%;
281
+    float: right;
282
+}
283
+
284
+p.sidebar-title {
285
+    font-weight: bold;
286
+}
287
+
288
+/* -- topics ---------------------------------------------------------------- */
289
+
290
+div.topic {
291
+    border: 1px solid #ccc;
292
+    padding: 7px 7px 0 7px;
293
+    margin: 10px 0 10px 0;
294
+}
295
+
296
+p.topic-title {
297
+    font-size: 1.1em;
298
+    font-weight: bold;
299
+    margin-top: 10px;
300
+}
301
+
302
+/* -- admonitions ----------------------------------------------------------- */
303
+
304
+div.admonition {
305
+    margin-top: 10px;
306
+    margin-bottom: 10px;
307
+    padding: 7px;
308
+}
309
+
310
+div.admonition dt {
311
+    font-weight: bold;
312
+}
313
+
314
+div.admonition dl {
315
+    margin-bottom: 0;
316
+}
317
+
318
+p.admonition-title {
319
+    margin: 0px 10px 5px 0px;
320
+    font-weight: bold;
321
+}
322
+
323
+div.body p.centered {
324
+    text-align: center;
325
+    margin-top: 25px;
326
+}
327
+
328
+/* -- tables ---------------------------------------------------------------- */
329
+
330
+table.docutils {
331
+    border: 0;
332
+    border-collapse: collapse;
333
+}
334
+
335
+table.align-center {
336
+    margin-left: auto;
337
+    margin-right: auto;
338
+}
339
+
340
+table caption span.caption-number {
341
+    font-style: italic;
342
+}
343
+
344
+table caption span.caption-text {
345
+}
346
+
347
+table.docutils td, table.docutils th {
348
+    padding: 1px 8px 1px 5px;
349
+    border-top: 0;
350
+    border-left: 0;
351
+    border-right: 0;
352
+    border-bottom: 1px solid #aaa;
353
+}
354
+
355
+table.footnote td, table.footnote th {
356
+    border: 0 !important;
357
+}
358
+
359
+th {
360
+    text-align: left;
361
+    padding-right: 5px;
362
+}
363
+
364
+table.citation {
365
+    border-left: solid 1px gray;
366
+    margin-left: 1px;
367
+}
368
+
369
+table.citation td {
370
+    border-bottom: none;
371
+}
372
+
373
+/* -- figures --------------------------------------------------------------- */
374
+
375
+div.figure {
376
+    margin: 0.5em;
377
+    padding: 0.5em;
378
+}
379
+
380
+div.figure p.caption {
381
+    padding: 0.3em;
382
+}
383
+
384
+div.figure p.caption span.caption-number {
385
+    font-style: italic;
386
+}
387
+
388
+div.figure p.caption span.caption-text {
389
+}
390
+
391
+/* -- field list styles ----------------------------------------------------- */
392
+
393
+table.field-list td, table.field-list th {
394
+    border: 0 !important;
395
+}
396
+
397
+.field-list ul {
398
+    margin: 0;
399
+    padding-left: 1em;
400
+}
401
+
402
+.field-list p {
403
+    margin: 0;
404
+}
405
+
406
+.field-name {
407
+    -moz-hyphens: manual;
408
+    -ms-hyphens: manual;
409
+    -webkit-hyphens: manual;
410
+    hyphens: manual;
411
+}
412
+
413
+/* -- other body styles ----------------------------------------------------- */
414
+
415
+ol.arabic {
416
+    list-style: decimal;
417
+}
418
+
419
+ol.loweralpha {
420
+    list-style: lower-alpha;
421
+}
422
+
423
+ol.upperalpha {
424
+    list-style: upper-alpha;
425
+}
426
+
427
+ol.lowerroman {
428
+    list-style: lower-roman;
429
+}
430
+
431
+ol.upperroman {
432
+    list-style: upper-roman;
433
+}
434
+
435
+dl {
436
+    margin-bottom: 15px;
437
+}
438
+
439
+dd p {
440
+    margin-top: 0px;
441
+}
442
+
443
+dd ul, dd table {
444
+    margin-bottom: 10px;
445
+}
446
+
447
+dd {
448
+    margin-top: 3px;
449
+    margin-bottom: 10px;
450
+    margin-left: 30px;
451
+}
452
+
453
+dt:target, span.highlighted {
454
+    background-color: #fbe54e;
455
+}
456
+
457
+rect.highlighted {
458
+    fill: #fbe54e;
459
+}
460
+
461
+dl.glossary dt {
462
+    font-weight: bold;
463
+    font-size: 1.1em;
464
+}
465
+
466
+.optional {
467
+    font-size: 1.3em;
468
+}
469
+
470
+.sig-paren {
471
+    font-size: larger;
472
+}
473
+
474
+.versionmodified {
475
+    font-style: italic;
476
+}
477
+
478
+.system-message {
479
+    background-color: #fda;
480
+    padding: 5px;
481
+    border: 3px solid red;
482
+}
483
+
484
+.footnote:target  {
485
+    background-color: #ffa;
486
+}
487
+
488
+.line-block {
489
+    display: block;
490
+    margin-top: 1em;
491
+    margin-bottom: 1em;
492
+}
493
+
494
+.line-block .line-block {
495
+    margin-top: 0;
496
+    margin-bottom: 0;
497
+    margin-left: 1.5em;
498
+}
499
+
500
+.guilabel, .menuselection {
501
+    font-family: sans-serif;
502
+}
503
+
504
+.accelerator {
505
+    text-decoration: underline;
506
+}
507
+
508
+.classifier {
509
+    font-style: oblique;
510
+}
511
+
512
+abbr, acronym {
513
+    border-bottom: dotted 1px;
514
+    cursor: help;
515
+}
516
+
517
+/* -- code displays --------------------------------------------------------- */
518
+
519
+pre {
520
+    overflow: auto;
521
+    overflow-y: hidden;  /* fixes display issues on Chrome browsers */
522
+}
523
+
524
+span.pre {
525
+    -moz-hyphens: none;
526
+    -ms-hyphens: none;
527
+    -webkit-hyphens: none;
528
+    hyphens: none;
529
+}
530
+
531
+td.linenos pre {
532
+    padding: 5px 0px;
533
+    border: 0;
534
+    background-color: transparent;
535
+    color: #aaa;
536
+}
537
+
538
+table.highlighttable {
539
+    margin-left: 0.5em;
540
+}
541
+
542
+table.highlighttable td {
543
+    padding: 0 0.5em 0 0.5em;
544
+}
545
+
546
+div.code-block-caption {
547
+    padding: 2px 5px;
548
+    font-size: small;
549
+}
550
+
551
+div.code-block-caption code {
552
+    background-color: transparent;
553
+}
554
+
555
+div.code-block-caption + div > div.highlight > pre {
556
+    margin-top: 0;
557
+}
558
+
559
+div.code-block-caption span.caption-number {
560
+    padding: 0.1em 0.3em;
561
+    font-style: italic;
562
+}
563
+
564
+div.code-block-caption span.caption-text {
565
+}
566
+
567
+div.literal-block-wrapper {
568
+    padding: 1em 1em 0;
569
+}
570
+
571
+div.literal-block-wrapper div.highlight {
572
+    margin: 0;
573
+}
574
+
575
+code.descname {
576
+    background-color: transparent;
577
+    font-weight: bold;
578
+    font-size: 1.2em;
579
+}
580
+
581
+code.descclassname {
582
+    background-color: transparent;
583
+}
584
+
585
+code.xref, a code {
586
+    background-color: transparent;
587
+    font-weight: bold;
588
+}
589
+
590
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
591
+    background-color: transparent;
592
+}
593
+
594
+.viewcode-link {
595
+    float: right;
596
+}
597
+
598
+.viewcode-back {
599
+    float: right;
600
+    font-family: sans-serif;
601
+}
602
+
603
+div.viewcode-block:target {
604
+    margin: -1px -10px;
605
+    padding: 0 10px;
606
+}
607
+
608
+/* -- math display ---------------------------------------------------------- */
609
+
610
+img.math {
611
+    vertical-align: middle;
612
+}
613
+
614
+div.body div.math p {
615
+    text-align: center;
616
+}
617
+
618
+span.eqno {
619
+    float: right;
620
+}
621
+
622
+span.eqno a.headerlink {
623
+    position: relative;
624
+    left: 0px;
625
+    z-index: 1;
626
+}
627
+
628
+div.math:hover a.headerlink {
629
+    visibility: visible;
630
+}
631
+
632
+/* -- printout stylesheet --------------------------------------------------- */
633
+
634
+@media print {
635
+    div.document,
636
+    div.documentwrapper,
637
+    div.bodywrapper {
638
+        margin: 0 !important;
639
+        width: 100%;
640
+    }
641
+
642
+    div.sphinxsidebar,
643
+    div.related,
644
+    div.footer,
645
+    #top-link {
646
+        display: none;
647
+    }
648
+}

BIN
_docs_/_static/comment-bright.png Dosyayı Görüntüle


BIN
_docs_/_static/comment-close.png Dosyayı Görüntüle


BIN
_docs_/_static/comment.png Dosyayı Görüntüle


+ 1
- 0
_docs_/_static/custom.css Dosyayı Görüntüle

@@ -0,0 +1 @@
1
+/* This file intentionally left blank. */

+ 311
- 0
_docs_/_static/doctools.js Dosyayı Görüntüle

@@ -0,0 +1,311 @@
1
+/*
2
+ * doctools.js
3
+ * ~~~~~~~~~~~
4
+ *
5
+ * Sphinx JavaScript utilities for all documentation.
6
+ *
7
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+/**
13
+ * select a different prefix for underscore
14
+ */
15
+$u = _.noConflict();
16
+
17
+/**
18
+ * make the code below compatible with browsers without
19
+ * an installed firebug like debugger
20
+if (!window.console || !console.firebug) {
21
+  var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
22
+    "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
23
+    "profile", "profileEnd"];
24
+  window.console = {};
25
+  for (var i = 0; i < names.length; ++i)
26
+    window.console[names[i]] = function() {};
27
+}
28
+ */
29
+
30
+/**
31
+ * small helper function to urldecode strings
32
+ */
33
+jQuery.urldecode = function(x) {
34
+  return decodeURIComponent(x).replace(/\+/g, ' ');
35
+};
36
+
37
+/**
38
+ * small helper function to urlencode strings
39
+ */
40
+jQuery.urlencode = encodeURIComponent;
41
+
42
+/**
43
+ * This function returns the parsed url parameters of the
44
+ * current request. Multiple values per key are supported,
45
+ * it will always return arrays of strings for the value parts.
46
+ */
47
+jQuery.getQueryParameters = function(s) {
48
+  if (typeof s === 'undefined')
49
+    s = document.location.search;
50
+  var parts = s.substr(s.indexOf('?') + 1).split('&');
51
+  var result = {};
52
+  for (var i = 0; i < parts.length; i++) {
53
+    var tmp = parts[i].split('=', 2);
54
+    var key = jQuery.urldecode(tmp[0]);
55
+    var value = jQuery.urldecode(tmp[1]);
56
+    if (key in result)
57
+      result[key].push(value);
58
+    else
59
+      result[key] = [value];
60
+  }
61
+  return result;
62
+};
63
+
64
+/**
65
+ * highlight a given string on a jquery object by wrapping it in
66
+ * span elements with the given class name.
67
+ */
68
+jQuery.fn.highlightText = function(text, className) {
69
+  function highlight(node, addItems) {
70
+    if (node.nodeType === 3) {
71
+      var val = node.nodeValue;
72
+      var pos = val.toLowerCase().indexOf(text);
73
+      if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
74
+        var span;
75
+        var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
76
+        if (isInSVG) {
77
+          span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
78
+        } else {
79
+          span = document.createElement("span");
80
+          span.className = className;
81
+        }
82
+        span.appendChild(document.createTextNode(val.substr(pos, text.length)));
83
+        node.parentNode.insertBefore(span, node.parentNode.insertBefore(
84
+          document.createTextNode(val.substr(pos + text.length)),
85
+          node.nextSibling));
86
+        node.nodeValue = val.substr(0, pos);
87
+        if (isInSVG) {
88
+          var bbox = span.getBBox();
89
+          var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
90
+       	  rect.x.baseVal.value = bbox.x;
91
+          rect.y.baseVal.value = bbox.y;
92
+          rect.width.baseVal.value = bbox.width;
93
+          rect.height.baseVal.value = bbox.height;
94
+          rect.setAttribute('class', className);
95
+          var parentOfText = node.parentNode.parentNode;
96
+          addItems.push({
97
+              "parent": node.parentNode,
98
+              "target": rect});
99
+        }
100
+      }
101
+    }
102
+    else if (!jQuery(node).is("button, select, textarea")) {
103
+      jQuery.each(node.childNodes, function() {
104
+        highlight(this, addItems);
105
+      });
106
+    }
107
+  }
108
+  var addItems = [];
109
+  var result = this.each(function() {
110
+    highlight(this, addItems);
111
+  });
112
+  for (var i = 0; i < addItems.length; ++i) {
113
+    jQuery(addItems[i].parent).before(addItems[i].target);
114
+  }
115
+  return result;
116
+};
117
+
118
+/*
119
+ * backward compatibility for jQuery.browser
120
+ * This will be supported until firefox bug is fixed.
121
+ */
122
+if (!jQuery.browser) {
123
+  jQuery.uaMatch = function(ua) {
124
+    ua = ua.toLowerCase();
125
+
126
+    var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
127
+      /(webkit)[ \/]([\w.]+)/.exec(ua) ||
128
+      /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
129
+      /(msie) ([\w.]+)/.exec(ua) ||
130
+      ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
131
+      [];
132
+
133
+    return {
134
+      browser: match[ 1 ] || "",
135
+      version: match[ 2 ] || "0"
136
+    };
137
+  };
138
+  jQuery.browser = {};
139
+  jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
140
+}
141
+
142
+/**
143
+ * Small JavaScript module for the documentation.
144
+ */
145
+var Documentation = {
146
+
147
+  init : function() {
148
+    this.fixFirefoxAnchorBug();
149
+    this.highlightSearchWords();
150
+    this.initIndexTable();
151
+    
152
+  },
153
+
154
+  /**
155
+   * i18n support
156
+   */
157
+  TRANSLATIONS : {},
158
+  PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
159
+  LOCALE : 'unknown',
160
+
161
+  // gettext and ngettext don't access this so that the functions
162
+  // can safely bound to a different name (_ = Documentation.gettext)
163
+  gettext : function(string) {
164
+    var translated = Documentation.TRANSLATIONS[string];
165
+    if (typeof translated === 'undefined')
166
+      return string;
167
+    return (typeof translated === 'string') ? translated : translated[0];
168
+  },
169
+
170
+  ngettext : function(singular, plural, n) {
171
+    var translated = Documentation.TRANSLATIONS[singular];
172
+    if (typeof translated === 'undefined')
173
+      return (n == 1) ? singular : plural;
174
+    return translated[Documentation.PLURALEXPR(n)];
175
+  },
176
+
177
+  addTranslations : function(catalog) {
178
+    for (var key in catalog.messages)
179
+      this.TRANSLATIONS[key] = catalog.messages[key];
180
+    this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
181
+    this.LOCALE = catalog.locale;
182
+  },
183
+
184
+  /**
185
+   * add context elements like header anchor links
186
+   */
187
+  addContextElements : function() {
188
+    $('div[id] > :header:first').each(function() {
189
+      $('<a class="headerlink">\u00B6</a>').
190
+      attr('href', '#' + this.id).
191
+      attr('title', _('Permalink to this headline')).
192
+      appendTo(this);
193
+    });
194
+    $('dt[id]').each(function() {
195
+      $('<a class="headerlink">\u00B6</a>').
196
+      attr('href', '#' + this.id).
197
+      attr('title', _('Permalink to this definition')).
198
+      appendTo(this);
199
+    });
200
+  },
201
+
202
+  /**
203
+   * workaround a firefox stupidity
204
+   * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
205
+   */
206
+  fixFirefoxAnchorBug : function() {
207
+    if (document.location.hash && $.browser.mozilla)
208
+      window.setTimeout(function() {
209
+        document.location.href += '';
210
+      }, 10);
211
+  },
212
+
213
+  /**
214
+   * highlight the search words provided in the url in the text
215
+   */
216
+  highlightSearchWords : function() {
217
+    var params = $.getQueryParameters();
218
+    var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
219
+    if (terms.length) {
220
+      var body = $('div.body');
221
+      if (!body.length) {
222
+        body = $('body');
223
+      }
224
+      window.setTimeout(function() {
225
+        $.each(terms, function() {
226
+          body.highlightText(this.toLowerCase(), 'highlighted');
227
+        });
228
+      }, 10);
229
+      $('<p class="highlight-link"><a href="javascript:Documentation.' +
230
+        'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
231
+          .appendTo($('#searchbox'));
232
+    }
233
+  },
234
+
235
+  /**
236
+   * init the domain index toggle buttons
237
+   */
238
+  initIndexTable : function() {
239
+    var togglers = $('img.toggler').click(function() {
240
+      var src = $(this).attr('src');
241
+      var idnum = $(this).attr('id').substr(7);
242
+      $('tr.cg-' + idnum).toggle();
243
+      if (src.substr(-9) === 'minus.png')
244
+        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
245
+      else
246
+        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
247
+    }).css('display', '');
248
+    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
249
+        togglers.click();
250
+    }
251
+  },
252
+
253
+  /**
254
+   * helper function to hide the search marks again
255
+   */
256
+  hideSearchWords : function() {
257
+    $('#searchbox .highlight-link').fadeOut(300);
258
+    $('span.highlighted').removeClass('highlighted');
259
+  },
260
+
261
+  /**
262
+   * make the url absolute
263
+   */
264
+  makeURL : function(relativeURL) {
265
+    return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
266
+  },
267
+
268
+  /**
269
+   * get the current relative url
270
+   */
271
+  getCurrentURL : function() {
272
+    var path = document.location.pathname;
273
+    var parts = path.split(/\//);
274
+    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
275
+      if (this === '..')
276
+        parts.pop();
277
+    });
278
+    var url = parts.join('/');
279
+    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
280
+  },
281
+
282
+  initOnKeyListeners: function() {
283
+    $(document).keyup(function(event) {
284
+      var activeElementType = document.activeElement.tagName;
285
+      // don't navigate when in search box or textarea
286
+      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
287
+        switch (event.keyCode) {
288
+          case 37: // left
289
+            var prevHref = $('link[rel="prev"]').prop('href');
290
+            if (prevHref) {
291
+              window.location.href = prevHref;
292
+              return false;
293
+            }
294
+          case 39: // right
295
+            var nextHref = $('link[rel="next"]').prop('href');
296
+            if (nextHref) {
297
+              window.location.href = nextHref;
298
+              return false;
299
+            }
300
+        }
301
+      }
302
+    });
303
+  }
304
+};
305
+
306
+// quick alias for translations
307
+_ = Documentation.gettext;
308
+
309
+$(document).ready(function() {
310
+  Documentation.init();
311
+});

+ 10
- 0
_docs_/_static/documentation_options.js Dosyayı Görüntüle

@@ -0,0 +1,10 @@
1
+var DOCUMENTATION_OPTIONS = {
2
+    URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3
+    VERSION: '',
4
+    LANGUAGE: 'None',
5
+    COLLAPSE_INDEX: false,
6
+    FILE_SUFFIX: '.html',
7
+    HAS_SOURCE: true,
8
+    SOURCELINK_SUFFIX: '.txt',
9
+    NAVIGATION_WITH_KEYS: false,
10
+};

BIN
_docs_/_static/down-pressed.png Dosyayı Görüntüle


BIN
_docs_/_static/down.png Dosyayı Görüntüle


BIN
_docs_/_static/file.png Dosyayı Görüntüle


+ 10253
- 0
_docs_/_static/jquery-3.2.1.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 10253
- 0
_docs_/_static/jquery.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 297
- 0
_docs_/_static/language_data.js Dosyayı Görüntüle

@@ -0,0 +1,297 @@
1
+/*
2
+ * language_data.js
3
+ * ~~~~~~~~~~~~~~~~
4
+ *
5
+ * This script contains the language-specific data used by searchtools.js,
6
+ * namely the list of stopwords, stemmer, scorer and splitter.
7
+ *
8
+ * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
9
+ * :license: BSD, see LICENSE for details.
10
+ *
11
+ */
12
+
13
+var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
14
+
15
+
16
+/* Non-minified version JS is _stemmer.js if file is provided */ 
17
+/**
18
+ * Porter Stemmer
19
+ */
20
+var Stemmer = function() {
21
+
22
+  var step2list = {
23
+    ational: 'ate',
24
+    tional: 'tion',
25
+    enci: 'ence',
26
+    anci: 'ance',
27
+    izer: 'ize',
28
+    bli: 'ble',
29
+    alli: 'al',
30
+    entli: 'ent',
31
+    eli: 'e',
32
+    ousli: 'ous',
33
+    ization: 'ize',
34
+    ation: 'ate',
35
+    ator: 'ate',
36
+    alism: 'al',
37
+    iveness: 'ive',
38
+    fulness: 'ful',
39
+    ousness: 'ous',
40
+    aliti: 'al',
41
+    iviti: 'ive',
42
+    biliti: 'ble',
43
+    logi: 'log'
44
+  };
45
+
46
+  var step3list = {
47
+    icate: 'ic',
48
+    ative: '',
49
+    alize: 'al',
50
+    iciti: 'ic',
51
+    ical: 'ic',
52
+    ful: '',
53
+    ness: ''
54
+  };
55
+
56
+  var c = "[^aeiou]";          // consonant
57
+  var v = "[aeiouy]";          // vowel
58
+  var C = c + "[^aeiouy]*";    // consonant sequence
59
+  var V = v + "[aeiou]*";      // vowel sequence
60
+
61
+  var mgr0 = "^(" + C + ")?" + V + C;                      // [C]VC... is m>0
62
+  var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$";    // [C]VC[V] is m=1
63
+  var mgr1 = "^(" + C + ")?" + V + C + V + C;              // [C]VCVC... is m>1
64
+  var s_v   = "^(" + C + ")?" + v;                         // vowel in stem
65
+
66
+  this.stemWord = function (w) {
67
+    var stem;
68
+    var suffix;
69
+    var firstch;
70
+    var origword = w;
71
+
72
+    if (w.length < 3)
73
+      return w;
74
+
75
+    var re;
76
+    var re2;
77
+    var re3;
78
+    var re4;
79
+
80
+    firstch = w.substr(0,1);
81
+    if (firstch == "y")
82
+      w = firstch.toUpperCase() + w.substr(1);
83
+
84
+    // Step 1a
85
+    re = /^(.+?)(ss|i)es$/;
86
+    re2 = /^(.+?)([^s])s$/;
87
+
88
+    if (re.test(w))
89
+      w = w.replace(re,"$1$2");
90
+    else if (re2.test(w))
91
+      w = w.replace(re2,"$1$2");
92
+
93
+    // Step 1b
94
+    re = /^(.+?)eed$/;
95
+    re2 = /^(.+?)(ed|ing)$/;
96
+    if (re.test(w)) {
97
+      var fp = re.exec(w);
98
+      re = new RegExp(mgr0);
99
+      if (re.test(fp[1])) {
100
+        re = /.$/;
101
+        w = w.replace(re,"");
102
+      }
103
+    }
104
+    else if (re2.test(w)) {
105
+      var fp = re2.exec(w);
106
+      stem = fp[1];
107
+      re2 = new RegExp(s_v);
108
+      if (re2.test(stem)) {
109
+        w = stem;
110
+        re2 = /(at|bl|iz)$/;
111
+        re3 = new RegExp("([^aeiouylsz])\\1$");
112
+        re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
113
+        if (re2.test(w))
114
+          w = w + "e";
115
+        else if (re3.test(w)) {
116
+          re = /.$/;
117
+          w = w.replace(re,"");
118
+        }
119
+        else if (re4.test(w))
120
+          w = w + "e";
121
+      }
122
+    }
123
+
124
+    // Step 1c
125
+    re = /^(.+?)y$/;
126
+    if (re.test(w)) {
127
+      var fp = re.exec(w);
128
+      stem = fp[1];
129
+      re = new RegExp(s_v);
130
+      if (re.test(stem))
131
+        w = stem + "i";
132
+    }
133
+
134
+    // Step 2
135
+    re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
136
+    if (re.test(w)) {
137
+      var fp = re.exec(w);
138
+      stem = fp[1];
139
+      suffix = fp[2];
140
+      re = new RegExp(mgr0);
141
+      if (re.test(stem))
142
+        w = stem + step2list[suffix];
143
+    }
144
+
145
+    // Step 3
146
+    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
147
+    if (re.test(w)) {
148
+      var fp = re.exec(w);
149
+      stem = fp[1];
150
+      suffix = fp[2];
151
+      re = new RegExp(mgr0);
152
+      if (re.test(stem))
153
+        w = stem + step3list[suffix];
154
+    }
155
+
156
+    // Step 4
157
+    re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
158
+    re2 = /^(.+?)(s|t)(ion)$/;
159
+    if (re.test(w)) {
160
+      var fp = re.exec(w);
161
+      stem = fp[1];
162
+      re = new RegExp(mgr1);
163
+      if (re.test(stem))
164
+        w = stem;
165
+    }
166
+    else if (re2.test(w)) {
167
+      var fp = re2.exec(w);
168
+      stem = fp[1] + fp[2];
169
+      re2 = new RegExp(mgr1);
170
+      if (re2.test(stem))
171
+        w = stem;
172
+    }
173
+
174
+    // Step 5
175
+    re = /^(.+?)e$/;
176
+    if (re.test(w)) {
177
+      var fp = re.exec(w);
178
+      stem = fp[1];
179
+      re = new RegExp(mgr1);
180
+      re2 = new RegExp(meq1);
181
+      re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
182
+      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
183
+        w = stem;
184
+    }
185
+    re = /ll$/;
186
+    re2 = new RegExp(mgr1);
187
+    if (re.test(w) && re2.test(w)) {
188
+      re = /.$/;
189
+      w = w.replace(re,"");
190
+    }
191
+
192
+    // and turn initial Y back to y
193
+    if (firstch == "y")
194
+      w = firstch.toLowerCase() + w.substr(1);
195
+    return w;
196
+  }
197
+}
198
+
199
+
200
+
201
+
202
+
203
+var splitChars = (function() {
204
+    var result = {};
205
+    var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
206
+         1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
207
+         2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
208
+         2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
209
+         3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
210
+         3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
211
+         4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
212
+         8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
213
+         11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
214
+         43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
215
+    var i, j, start, end;
216
+    for (i = 0; i < singles.length; i++) {
217
+        result[singles[i]] = true;
218
+    }
219
+    var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
220
+         [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
221
+         [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
222
+         [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
223
+         [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
224
+         [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
225
+         [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
226
+         [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
227
+         [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
228
+         [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
229
+         [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
230
+         [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
231
+         [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
232
+         [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
233
+         [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
234
+         [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
235
+         [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
236
+         [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
237
+         [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
238
+         [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
239
+         [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
240
+         [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
241
+         [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
242
+         [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
243
+         [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
244
+         [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
245
+         [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
246
+         [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
247
+         [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
248
+         [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
249
+         [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
250
+         [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
251
+         [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
252
+         [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
253
+         [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
254
+         [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
255
+         [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
256
+         [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
257
+         [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
258
+         [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
259
+         [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
260
+         [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
261
+         [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
262
+         [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
263
+         [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
264
+         [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
265
+         [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
266
+         [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
267
+         [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
268
+    for (i = 0; i < ranges.length; i++) {
269
+        start = ranges[i][0];
270
+        end = ranges[i][1];
271
+        for (j = start; j <= end; j++) {
272
+            result[j] = true;
273
+        }
274
+    }
275
+    return result;
276
+})();
277
+
278
+function splitQuery(query) {
279
+    var result = [];
280
+    var start = -1;
281
+    for (var i = 0; i < query.length; i++) {
282
+        if (splitChars[query.charCodeAt(i)]) {
283
+            if (start !== -1) {
284
+                result.push(query.slice(start, i));
285
+                start = -1;
286
+            }
287
+        } else if (start === -1) {
288
+            start = i;
289
+        }
290
+    }
291
+    if (start !== -1) {
292
+        result.push(query.slice(start));
293
+    }
294
+    return result;
295
+}
296
+
297
+

BIN
_docs_/_static/minus.png Dosyayı Görüntüle


BIN
_docs_/_static/plus.png Dosyayı Görüntüle


+ 69
- 0
_docs_/_static/pygments.css Dosyayı Görüntüle

@@ -0,0 +1,69 @@
1
+.highlight .hll { background-color: #ffffcc }
2
+.highlight  { background: #eeffcc; }
3
+.highlight .c { color: #408090; font-style: italic } /* Comment */
4
+.highlight .err { border: 1px solid #FF0000 } /* Error */
5
+.highlight .k { color: #007020; font-weight: bold } /* Keyword */
6
+.highlight .o { color: #666666 } /* Operator */
7
+.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
8
+.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
9
+.highlight .cp { color: #007020 } /* Comment.Preproc */
10
+.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
11
+.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
12
+.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
13
+.highlight .gd { color: #A00000 } /* Generic.Deleted */
14
+.highlight .ge { font-style: italic } /* Generic.Emph */
15
+.highlight .gr { color: #FF0000 } /* Generic.Error */
16
+.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
17
+.highlight .gi { color: #00A000 } /* Generic.Inserted */
18
+.highlight .go { color: #333333 } /* Generic.Output */
19
+.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
20
+.highlight .gs { font-weight: bold } /* Generic.Strong */
21
+.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
22
+.highlight .gt { color: #0044DD } /* Generic.Traceback */
23
+.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
24
+.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
25
+.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
26
+.highlight .kp { color: #007020 } /* Keyword.Pseudo */
27
+.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
28
+.highlight .kt { color: #902000 } /* Keyword.Type */
29
+.highlight .m { color: #208050 } /* Literal.Number */
30
+.highlight .s { color: #4070a0 } /* Literal.String */
31
+.highlight .na { color: #4070a0 } /* Name.Attribute */
32
+.highlight .nb { color: #007020 } /* Name.Builtin */
33
+.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
34
+.highlight .no { color: #60add5 } /* Name.Constant */
35
+.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
36
+.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
37
+.highlight .ne { color: #007020 } /* Name.Exception */
38
+.highlight .nf { color: #06287e } /* Name.Function */
39
+.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
40
+.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
41
+.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
42
+.highlight .nv { color: #bb60d5 } /* Name.Variable */
43
+.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
44
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
45
+.highlight .mb { color: #208050 } /* Literal.Number.Bin */
46
+.highlight .mf { color: #208050 } /* Literal.Number.Float */
47
+.highlight .mh { color: #208050 } /* Literal.Number.Hex */
48
+.highlight .mi { color: #208050 } /* Literal.Number.Integer */
49
+.highlight .mo { color: #208050 } /* Literal.Number.Oct */
50
+.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
51
+.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
52
+.highlight .sc { color: #4070a0 } /* Literal.String.Char */
53
+.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
54
+.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
55
+.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
56
+.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
57
+.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
58
+.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
59
+.highlight .sx { color: #c65d09 } /* Literal.String.Other */
60
+.highlight .sr { color: #235388 } /* Literal.String.Regex */
61
+.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
62
+.highlight .ss { color: #517918 } /* Literal.String.Symbol */
63
+.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
64
+.highlight .fm { color: #06287e } /* Name.Function.Magic */
65
+.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
66
+.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
67
+.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
68
+.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
69
+.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */

+ 761
- 0
_docs_/_static/searchtools.js Dosyayı Görüntüle

@@ -0,0 +1,761 @@
1
+/*
2
+ * searchtools.js_t
3
+ * ~~~~~~~~~~~~~~~~
4
+ *
5
+ * Sphinx JavaScript utilities for the full-text search.
6
+ *
7
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+
13
+/* Non-minified version JS is _stemmer.js if file is provided */ 
14
+/**
15
+ * Porter Stemmer
16
+ */
17
+var Stemmer = function() {
18
+
19
+  var step2list = {
20
+    ational: 'ate',
21
+    tional: 'tion',
22
+    enci: 'ence',
23
+    anci: 'ance',
24
+    izer: 'ize',
25
+    bli: 'ble',
26
+    alli: 'al',
27
+    entli: 'ent',
28
+    eli: 'e',
29
+    ousli: 'ous',
30
+    ization: 'ize',
31
+    ation: 'ate',
32
+    ator: 'ate',
33
+    alism: 'al',
34
+    iveness: 'ive',
35
+    fulness: 'ful',
36
+    ousness: 'ous',
37
+    aliti: 'al',
38
+    iviti: 'ive',
39
+    biliti: 'ble',
40
+    logi: 'log'
41
+  };
42
+
43
+  var step3list = {
44
+    icate: 'ic',
45
+    ative: '',
46
+    alize: 'al',
47
+    iciti: 'ic',
48
+    ical: 'ic',
49
+    ful: '',
50
+    ness: ''
51
+  };
52
+
53
+  var c = "[^aeiou]";          // consonant
54
+  var v = "[aeiouy]";          // vowel
55
+  var C = c + "[^aeiouy]*";    // consonant sequence
56
+  var V = v + "[aeiou]*";      // vowel sequence
57
+
58
+  var mgr0 = "^(" + C + ")?" + V + C;                      // [C]VC... is m>0
59
+  var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$";    // [C]VC[V] is m=1
60
+  var mgr1 = "^(" + C + ")?" + V + C + V + C;              // [C]VCVC... is m>1
61
+  var s_v   = "^(" + C + ")?" + v;                         // vowel in stem
62
+
63
+  this.stemWord = function (w) {
64
+    var stem;
65
+    var suffix;
66
+    var firstch;
67
+    var origword = w;
68
+
69
+    if (w.length < 3)
70
+      return w;
71
+
72
+    var re;
73
+    var re2;
74
+    var re3;
75
+    var re4;
76
+
77
+    firstch = w.substr(0,1);
78
+    if (firstch == "y")
79
+      w = firstch.toUpperCase() + w.substr(1);
80
+
81
+    // Step 1a
82
+    re = /^(.+?)(ss|i)es$/;
83
+    re2 = /^(.+?)([^s])s$/;
84
+
85
+    if (re.test(w))
86
+      w = w.replace(re,"$1$2");
87
+    else if (re2.test(w))
88
+      w = w.replace(re2,"$1$2");
89
+
90
+    // Step 1b
91
+    re = /^(.+?)eed$/;
92
+    re2 = /^(.+?)(ed|ing)$/;
93
+    if (re.test(w)) {
94
+      var fp = re.exec(w);
95
+      re = new RegExp(mgr0);
96
+      if (re.test(fp[1])) {
97
+        re = /.$/;
98
+        w = w.replace(re,"");
99
+      }
100
+    }
101
+    else if (re2.test(w)) {
102
+      var fp = re2.exec(w);
103
+      stem = fp[1];
104
+      re2 = new RegExp(s_v);
105
+      if (re2.test(stem)) {
106
+        w = stem;
107
+        re2 = /(at|bl|iz)$/;
108
+        re3 = new RegExp("([^aeiouylsz])\\1$");
109
+        re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
110
+        if (re2.test(w))
111
+          w = w + "e";
112
+        else if (re3.test(w)) {
113
+          re = /.$/;
114
+          w = w.replace(re,"");
115
+        }
116
+        else if (re4.test(w))
117
+          w = w + "e";
118
+      }
119
+    }
120
+
121
+    // Step 1c
122
+    re = /^(.+?)y$/;
123
+    if (re.test(w)) {
124
+      var fp = re.exec(w);
125
+      stem = fp[1];
126
+      re = new RegExp(s_v);
127
+      if (re.test(stem))
128
+        w = stem + "i";
129
+    }
130
+
131
+    // Step 2
132
+    re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
133
+    if (re.test(w)) {
134
+      var fp = re.exec(w);
135
+      stem = fp[1];
136
+      suffix = fp[2];
137
+      re = new RegExp(mgr0);
138
+      if (re.test(stem))
139
+        w = stem + step2list[suffix];
140
+    }
141
+
142
+    // Step 3
143
+    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
144
+    if (re.test(w)) {
145
+      var fp = re.exec(w);
146
+      stem = fp[1];
147
+      suffix = fp[2];
148
+      re = new RegExp(mgr0);
149
+      if (re.test(stem))
150
+        w = stem + step3list[suffix];
151
+    }
152
+
153
+    // Step 4
154
+    re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
155
+    re2 = /^(.+?)(s|t)(ion)$/;
156
+    if (re.test(w)) {
157
+      var fp = re.exec(w);
158
+      stem = fp[1];
159
+      re = new RegExp(mgr1);
160
+      if (re.test(stem))
161
+        w = stem;
162
+    }
163
+    else if (re2.test(w)) {
164
+      var fp = re2.exec(w);
165
+      stem = fp[1] + fp[2];
166
+      re2 = new RegExp(mgr1);
167
+      if (re2.test(stem))
168
+        w = stem;
169
+    }
170
+
171
+    // Step 5
172
+    re = /^(.+?)e$/;
173
+    if (re.test(w)) {
174
+      var fp = re.exec(w);
175
+      stem = fp[1];
176
+      re = new RegExp(mgr1);
177
+      re2 = new RegExp(meq1);
178
+      re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
179
+      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
180
+        w = stem;
181
+    }
182
+    re = /ll$/;
183
+    re2 = new RegExp(mgr1);
184
+    if (re.test(w) && re2.test(w)) {
185
+      re = /.$/;
186
+      w = w.replace(re,"");
187
+    }
188
+
189
+    // and turn initial Y back to y
190
+    if (firstch == "y")
191
+      w = firstch.toLowerCase() + w.substr(1);
192
+    return w;
193
+  }
194
+}
195
+
196
+
197
+
198
+/**
199
+ * Simple result scoring code.
200
+ */
201
+var Scorer = {
202
+  // Implement the following function to further tweak the score for each result
203
+  // The function takes a result array [filename, title, anchor, descr, score]
204
+  // and returns the new score.
205
+  /*
206
+  score: function(result) {
207
+    return result[4];
208
+  },
209
+  */
210
+
211
+  // query matches the full name of an object
212
+  objNameMatch: 11,
213
+  // or matches in the last dotted part of the object name
214
+  objPartialMatch: 6,
215
+  // Additive scores depending on the priority of the object
216
+  objPrio: {0:  15,   // used to be importantResults
217
+            1:  5,   // used to be objectResults
218
+            2: -5},  // used to be unimportantResults
219
+  //  Used when the priority is not in the mapping.
220
+  objPrioDefault: 0,
221
+
222
+  // query found in title
223
+  title: 15,
224
+  // query found in terms
225
+  term: 5
226
+};
227
+
228
+
229
+
230
+
231
+
232
+var splitChars = (function() {
233
+    var result = {};
234
+    var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
235
+         1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
236
+         2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
237
+         2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
238
+         3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
239
+         3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
240
+         4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
241
+         8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
242
+         11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
243
+         43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
244
+    var i, j, start, end;
245
+    for (i = 0; i < singles.length; i++) {
246
+        result[singles[i]] = true;
247
+    }
248
+    var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
249
+         [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
250
+         [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
251
+         [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
252
+         [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
253
+         [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
254
+         [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
255
+         [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
256
+         [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
257
+         [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
258
+         [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
259
+         [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
260
+         [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
261
+         [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
262
+         [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
263
+         [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
264
+         [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
265
+         [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
266
+         [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
267
+         [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
268
+         [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
269
+         [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
270
+         [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
271
+         [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
272
+         [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
273
+         [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
274
+         [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
275
+         [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
276
+         [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
277
+         [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
278
+         [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
279
+         [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
280
+         [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
281
+         [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
282
+         [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
283
+         [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
284
+         [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
285
+         [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
286
+         [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
287
+         [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
288
+         [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
289
+         [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
290
+         [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
291
+         [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
292
+         [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
293
+         [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
294
+         [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
295
+         [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
296
+         [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
297
+    for (i = 0; i < ranges.length; i++) {
298
+        start = ranges[i][0];
299
+        end = ranges[i][1];
300
+        for (j = start; j <= end; j++) {
301
+            result[j] = true;
302
+        }
303
+    }
304
+    return result;
305
+})();
306
+
307
+function splitQuery(query) {
308
+    var result = [];
309
+    var start = -1;
310
+    for (var i = 0; i < query.length; i++) {
311
+        if (splitChars[query.charCodeAt(i)]) {
312
+            if (start !== -1) {
313
+                result.push(query.slice(start, i));
314
+                start = -1;
315
+            }
316
+        } else if (start === -1) {
317
+            start = i;
318
+        }
319
+    }
320
+    if (start !== -1) {
321
+        result.push(query.slice(start));
322
+    }
323
+    return result;
324
+}
325
+
326
+
327
+
328
+
329
+/**
330
+ * Search Module
331
+ */
332
+var Search = {
333
+
334
+  _index : null,
335
+  _queued_query : null,
336
+  _pulse_status : -1,
337
+
338
+  init : function() {
339
+      var params = $.getQueryParameters();
340
+      if (params.q) {
341
+          var query = params.q[0];
342
+          $('input[name="q"]')[0].value = query;
343
+          this.performSearch(query);
344
+      }
345
+  },
346
+
347
+  loadIndex : function(url) {
348
+    $.ajax({type: "GET", url: url, data: null,
349
+            dataType: "script", cache: true,
350
+            complete: function(jqxhr, textstatus) {
351
+              if (textstatus != "success") {
352
+                document.getElementById("searchindexloader").src = url;
353
+              }
354
+            }});
355
+  },
356
+
357
+  setIndex : function(index) {
358
+    var q;
359
+    this._index = index;
360
+    if ((q = this._queued_query) !== null) {
361
+      this._queued_query = null;
362
+      Search.query(q);
363
+    }
364
+  },
365
+
366
+  hasIndex : function() {
367
+      return this._index !== null;
368
+  },
369
+
370
+  deferQuery : function(query) {
371
+      this._queued_query = query;
372
+  },
373
+
374
+  stopPulse : function() {
375
+      this._pulse_status = 0;
376
+  },
377
+
378
+  startPulse : function() {
379
+    if (this._pulse_status >= 0)
380
+        return;
381
+    function pulse() {
382
+      var i;
383
+      Search._pulse_status = (Search._pulse_status + 1) % 4;
384
+      var dotString = '';
385
+      for (i = 0; i < Search._pulse_status; i++)
386
+        dotString += '.';
387
+      Search.dots.text(dotString);
388
+      if (Search._pulse_status > -1)
389
+        window.setTimeout(pulse, 500);
390
+    }
391
+    pulse();
392
+  },
393
+
394
+  /**
395
+   * perform a search for something (or wait until index is loaded)
396
+   */
397
+  performSearch : function(query) {
398
+    // create the required interface elements
399
+    this.out = $('#search-results');
400
+    this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
401
+    this.dots = $('<span></span>').appendTo(this.title);
402
+    this.status = $('<p style="display: none"></p>').appendTo(this.out);
403
+    this.output = $('<ul class="search"/>').appendTo(this.out);
404
+
405
+    $('#search-progress').text(_('Preparing search...'));
406
+    this.startPulse();
407
+
408
+    // index already loaded, the browser was quick!
409
+    if (this.hasIndex())
410
+      this.query(query);
411
+    else
412
+      this.deferQuery(query);
413
+  },
414
+
415
+  /**
416
+   * execute search (requires search index to be loaded)
417
+   */
418
+  query : function(query) {
419
+    var i;
420
+    var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
421
+
422
+    // stem the searchterms and add them to the correct list
423
+    var stemmer = new Stemmer();
424
+    var searchterms = [];
425
+    var excluded = [];
426
+    var hlterms = [];
427
+    var tmp = splitQuery(query);
428
+    var objectterms = [];
429
+    for (i = 0; i < tmp.length; i++) {
430
+      if (tmp[i] !== "") {
431
+          objectterms.push(tmp[i].toLowerCase());
432
+      }
433
+
434
+      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
435
+          tmp[i] === "") {
436
+        // skip this "word"
437
+        continue;
438
+      }
439
+      // stem the word
440
+      var word = stemmer.stemWord(tmp[i].toLowerCase());
441
+      // prevent stemmer from cutting word smaller than two chars
442
+      if(word.length < 3 && tmp[i].length >= 3) {
443
+        word = tmp[i];
444
+      }
445
+      var toAppend;
446
+      // select the correct list
447
+      if (word[0] == '-') {
448
+        toAppend = excluded;
449
+        word = word.substr(1);
450
+      }
451
+      else {
452
+        toAppend = searchterms;
453
+        hlterms.push(tmp[i].toLowerCase());
454
+      }
455
+      // only add if not already in the list
456
+      if (!$u.contains(toAppend, word))
457
+        toAppend.push(word);
458
+    }
459
+    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
460
+
461
+    // console.debug('SEARCH: searching for:');
462
+    // console.info('required: ', searchterms);
463
+    // console.info('excluded: ', excluded);
464
+
465
+    // prepare search
466
+    var terms = this._index.terms;
467
+    var titleterms = this._index.titleterms;
468
+
469
+    // array of [filename, title, anchor, descr, score]
470
+    var results = [];
471
+    $('#search-progress').empty();
472
+
473
+    // lookup as object
474
+    for (i = 0; i < objectterms.length; i++) {
475
+      var others = [].concat(objectterms.slice(0, i),
476
+                             objectterms.slice(i+1, objectterms.length));
477
+      results = results.concat(this.performObjectSearch(objectterms[i], others));
478
+    }
479
+
480
+    // lookup as search terms in fulltext
481
+    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
482
+
483
+    // let the scorer override scores with a custom scoring function
484
+    if (Scorer.score) {
485
+      for (i = 0; i < results.length; i++)
486
+        results[i][4] = Scorer.score(results[i]);
487
+    }
488
+
489
+    // now sort the results by score (in opposite order of appearance, since the
490
+    // display function below uses pop() to retrieve items) and then
491
+    // alphabetically
492
+    results.sort(function(a, b) {
493
+      var left = a[4];
494
+      var right = b[4];
495
+      if (left > right) {
496
+        return 1;
497
+      } else if (left < right) {
498
+        return -1;
499
+      } else {
500
+        // same score: sort alphabetically
501
+        left = a[1].toLowerCase();
502
+        right = b[1].toLowerCase();
503
+        return (left > right) ? -1 : ((left < right) ? 1 : 0);
504
+      }
505
+    });
506
+
507
+    // for debugging
508
+    //Search.lastresults = results.slice();  // a copy
509
+    //console.info('search results:', Search.lastresults);
510
+
511
+    // print the results
512
+    var resultCount = results.length;
513
+    function displayNextItem() {
514
+      // results left, load the summary and display it
515
+      if (results.length) {
516
+        var item = results.pop();
517
+        var listItem = $('<li style="display:none"></li>');
518
+        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
519
+          // dirhtml builder
520
+          var dirname = item[0] + '/';
521
+          if (dirname.match(/\/index\/$/)) {
522
+            dirname = dirname.substring(0, dirname.length-6);
523
+          } else if (dirname == 'index/') {
524
+            dirname = '';
525
+          }
526
+          listItem.append($('<a/>').attr('href',
527
+            DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
528
+            highlightstring + item[2]).html(item[1]));
529
+        } else {
530
+          // normal html builders
531
+          listItem.append($('<a/>').attr('href',
532
+            item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
533
+            highlightstring + item[2]).html(item[1]));
534
+        }
535
+        if (item[3]) {
536
+          listItem.append($('<span> (' + item[3] + ')</span>'));
537
+          Search.output.append(listItem);
538
+          listItem.slideDown(5, function() {
539
+            displayNextItem();
540
+          });
541
+        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
542
+          var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
543
+          if (suffix === undefined) {
544
+            suffix = '.txt';
545
+          }
546
+          $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
547
+                  dataType: "text",
548
+                  complete: function(jqxhr, textstatus) {
549
+                    var data = jqxhr.responseText;
550
+                    if (data !== '' && data !== undefined) {
551
+                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
552
+                    }
553
+                    Search.output.append(listItem);
554
+                    listItem.slideDown(5, function() {
555
+                      displayNextItem();
556
+                    });
557
+                  }});
558
+        } else {
559
+          // no source available, just display title
560
+          Search.output.append(listItem);
561
+          listItem.slideDown(5, function() {
562
+            displayNextItem();
563
+          });
564
+        }
565
+      }
566
+      // search finished, update title and status message
567
+      else {
568
+        Search.stopPulse();
569
+        Search.title.text(_('Search Results'));
570
+        if (!resultCount)
571
+          Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
572
+        else
573
+            Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
574
+        Search.status.fadeIn(500);
575
+      }
576
+    }
577
+    displayNextItem();
578
+  },
579
+
580
+  /**
581
+   * search for object names
582
+   */
583
+  performObjectSearch : function(object, otherterms) {
584
+    var filenames = this._index.filenames;
585
+    var docnames = this._index.docnames;
586
+    var objects = this._index.objects;
587
+    var objnames = this._index.objnames;
588
+    var titles = this._index.titles;
589
+
590
+    var i;
591
+    var results = [];
592
+
593
+    for (var prefix in objects) {
594
+      for (var name in objects[prefix]) {
595
+        var fullname = (prefix ? prefix + '.' : '') + name;
596
+        if (fullname.toLowerCase().indexOf(object) > -1) {
597
+          var score = 0;
598
+          var parts = fullname.split('.');
599
+          // check for different match types: exact matches of full name or
600
+          // "last name" (i.e. last dotted part)
601
+          if (fullname == object || parts[parts.length - 1] == object) {
602
+            score += Scorer.objNameMatch;
603
+          // matches in last name
604
+          } else if (parts[parts.length - 1].indexOf(object) > -1) {
605
+            score += Scorer.objPartialMatch;
606
+          }
607
+          var match = objects[prefix][name];
608
+          var objname = objnames[match[1]][2];
609
+          var title = titles[match[0]];
610
+          // If more than one term searched for, we require other words to be
611
+          // found in the name/title/description
612
+          if (otherterms.length > 0) {
613
+            var haystack = (prefix + ' ' + name + ' ' +
614
+                            objname + ' ' + title).toLowerCase();
615
+            var allfound = true;
616
+            for (i = 0; i < otherterms.length; i++) {
617
+              if (haystack.indexOf(otherterms[i]) == -1) {
618
+                allfound = false;
619
+                break;
620
+              }
621
+            }
622
+            if (!allfound) {
623
+              continue;
624
+            }
625
+          }
626
+          var descr = objname + _(', in ') + title;
627
+
628
+          var anchor = match[3];
629
+          if (anchor === '')
630
+            anchor = fullname;
631
+          else if (anchor == '-')
632
+            anchor = objnames[match[1]][1] + '-' + fullname;
633
+          // add custom score for some objects according to scorer
634
+          if (Scorer.objPrio.hasOwnProperty(match[2])) {
635
+            score += Scorer.objPrio[match[2]];
636
+          } else {
637
+            score += Scorer.objPrioDefault;
638
+          }
639
+          results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
640
+        }
641
+      }
642
+    }
643
+
644
+    return results;
645
+  },
646
+
647
+  /**
648
+   * search for full-text terms in the index
649
+   */
650
+  performTermsSearch : function(searchterms, excluded, terms, titleterms) {
651
+    var docnames = this._index.docnames;
652
+    var filenames = this._index.filenames;
653
+    var titles = this._index.titles;
654
+
655
+    var i, j, file;
656
+    var fileMap = {};
657
+    var scoreMap = {};
658
+    var results = [];
659
+
660
+    // perform the search on the required terms
661
+    for (i = 0; i < searchterms.length; i++) {
662
+      var word = searchterms[i];
663
+      var files = [];
664
+      var _o = [
665
+        {files: terms[word], score: Scorer.term},
666
+        {files: titleterms[word], score: Scorer.title}
667
+      ];
668
+
669
+      // no match but word was a required one
670
+      if ($u.every(_o, function(o){return o.files === undefined;})) {
671
+        break;
672
+      }
673
+      // found search word in contents
674
+      $u.each(_o, function(o) {
675
+        var _files = o.files;
676
+        if (_files === undefined)
677
+          return
678
+
679
+        if (_files.length === undefined)
680
+          _files = [_files];
681
+        files = files.concat(_files);
682
+
683
+        // set score for the word in each file to Scorer.term
684
+        for (j = 0; j < _files.length; j++) {
685
+          file = _files[j];
686
+          if (!(file in scoreMap))
687
+            scoreMap[file] = {}
688
+          scoreMap[file][word] = o.score;
689
+        }
690
+      });
691
+
692
+      // create the mapping
693
+      for (j = 0; j < files.length; j++) {
694
+        file = files[j];
695
+        if (file in fileMap)
696
+          fileMap[file].push(word);
697
+        else
698
+          fileMap[file] = [word];
699
+      }
700
+    }
701
+
702
+    // now check if the files don't contain excluded terms
703
+    for (file in fileMap) {
704
+      var valid = true;
705
+
706
+      // check if all requirements are matched
707
+      if (fileMap[file].length != searchterms.length)
708
+          continue;
709
+
710
+      // ensure that none of the excluded terms is in the search result
711
+      for (i = 0; i < excluded.length; i++) {
712
+        if (terms[excluded[i]] == file ||
713
+            titleterms[excluded[i]] == file ||
714
+            $u.contains(terms[excluded[i]] || [], file) ||
715
+            $u.contains(titleterms[excluded[i]] || [], file)) {
716
+          valid = false;
717
+          break;
718
+        }
719
+      }
720
+
721
+      // if we have still a valid result we can add it to the result list
722
+      if (valid) {
723
+        // select one (max) score for the file.
724
+        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
725
+        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
726
+        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
727
+      }
728
+    }
729
+    return results;
730
+  },
731
+
732
+  /**
733
+   * helper function to return a node containing the
734
+   * search summary for a given text. keywords is a list
735
+   * of stemmed words, hlwords is the list of normal, unstemmed
736
+   * words. the first one is used to find the occurrence, the
737
+   * latter for highlighting it.
738
+   */
739
+  makeSearchSummary : function(text, keywords, hlwords) {
740
+    var textLower = text.toLowerCase();
741
+    var start = 0;
742
+    $.each(keywords, function() {
743
+      var i = textLower.indexOf(this.toLowerCase());
744
+      if (i > -1)
745
+        start = i;
746
+    });
747
+    start = Math.max(start - 120, 0);
748
+    var excerpt = ((start > 0) ? '...' : '') +
749
+      $.trim(text.substr(start, 240)) +
750
+      ((start + 240 - text.length) ? '...' : '');
751
+    var rv = $('<div class="context"></div>').text(excerpt);
752
+    $.each(hlwords, function() {
753
+      rv = rv.highlightText(this, 'highlighted');
754
+    });
755
+    return rv;
756
+  }
757
+};
758
+
759
+$(document).ready(function() {
760
+  Search.init();
761
+});

+ 999
- 0
_docs_/_static/underscore-1.3.1.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 1548
- 0
_docs_/_static/underscore.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


BIN
_docs_/_static/up-pressed.png Dosyayı Görüntüle


BIN
_docs_/_static/up.png Dosyayı Görüntüle


+ 808
- 0
_docs_/_static/websupport.js Dosyayı Görüntüle

@@ -0,0 +1,808 @@
1
+/*
2
+ * websupport.js
3
+ * ~~~~~~~~~~~~~
4
+ *
5
+ * sphinx.websupport utilities for all documentation.
6
+ *
7
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+(function($) {
13
+  $.fn.autogrow = function() {
14
+    return this.each(function() {
15
+    var textarea = this;
16
+
17
+    $.fn.autogrow.resize(textarea);
18
+
19
+    $(textarea)
20
+      .focus(function() {
21
+        textarea.interval = setInterval(function() {
22
+          $.fn.autogrow.resize(textarea);
23
+        }, 500);
24
+      })
25
+      .blur(function() {
26
+        clearInterval(textarea.interval);
27
+      });
28
+    });
29
+  };
30
+
31
+  $.fn.autogrow.resize = function(textarea) {
32
+    var lineHeight = parseInt($(textarea).css('line-height'), 10);
33
+    var lines = textarea.value.split('\n');
34
+    var columns = textarea.cols;
35
+    var lineCount = 0;
36
+    $.each(lines, function() {
37
+      lineCount += Math.ceil(this.length / columns) || 1;
38
+    });
39
+    var height = lineHeight * (lineCount + 1);
40
+    $(textarea).css('height', height);
41
+  };
42
+})(jQuery);
43
+
44
+(function($) {
45
+  var comp, by;
46
+
47
+  function init() {
48
+    initEvents();
49
+    initComparator();
50
+  }
51
+
52
+  function initEvents() {
53
+    $(document).on("click", 'a.comment-close', function(event) {
54
+      event.preventDefault();
55
+      hide($(this).attr('id').substring(2));
56
+    });
57
+    $(document).on("click", 'a.vote', function(event) {
58
+      event.preventDefault();
59
+      handleVote($(this));
60
+    });
61
+    $(document).on("click", 'a.reply', function(event) {
62
+      event.preventDefault();
63
+      openReply($(this).attr('id').substring(2));
64
+    });
65
+    $(document).on("click", 'a.close-reply', function(event) {
66
+      event.preventDefault();
67
+      closeReply($(this).attr('id').substring(2));
68
+    });
69
+    $(document).on("click", 'a.sort-option', function(event) {
70
+      event.preventDefault();
71
+      handleReSort($(this));
72
+    });
73
+    $(document).on("click", 'a.show-proposal', function(event) {
74
+      event.preventDefault();
75
+      showProposal($(this).attr('id').substring(2));
76
+    });
77
+    $(document).on("click", 'a.hide-proposal', function(event) {
78
+      event.preventDefault();
79
+      hideProposal($(this).attr('id').substring(2));
80
+    });
81
+    $(document).on("click", 'a.show-propose-change', function(event) {
82
+      event.preventDefault();
83
+      showProposeChange($(this).attr('id').substring(2));
84
+    });
85
+    $(document).on("click", 'a.hide-propose-change', function(event) {
86
+      event.preventDefault();
87
+      hideProposeChange($(this).attr('id').substring(2));
88
+    });
89
+    $(document).on("click", 'a.accept-comment', function(event) {
90
+      event.preventDefault();
91
+      acceptComment($(this).attr('id').substring(2));
92
+    });
93
+    $(document).on("click", 'a.delete-comment', function(event) {
94
+      event.preventDefault();
95
+      deleteComment($(this).attr('id').substring(2));
96
+    });
97
+    $(document).on("click", 'a.comment-markup', function(event) {
98
+      event.preventDefault();
99
+      toggleCommentMarkupBox($(this).attr('id').substring(2));
100
+    });
101
+  }
102
+
103
+  /**
104
+   * Set comp, which is a comparator function used for sorting and
105
+   * inserting comments into the list.
106
+   */
107
+  function setComparator() {
108
+    // If the first three letters are "asc", sort in ascending order
109
+    // and remove the prefix.
110
+    if (by.substring(0,3) == 'asc') {
111
+      var i = by.substring(3);
112
+      comp = function(a, b) { return a[i] - b[i]; };
113
+    } else {
114
+      // Otherwise sort in descending order.
115
+      comp = function(a, b) { return b[by] - a[by]; };
116
+    }
117
+
118
+    // Reset link styles and format the selected sort option.
119
+    $('a.sel').attr('href', '#').removeClass('sel');
120
+    $('a.by' + by).removeAttr('href').addClass('sel');
121
+  }
122
+
123
+  /**
124
+   * Create a comp function. If the user has preferences stored in
125
+   * the sortBy cookie, use those, otherwise use the default.
126
+   */
127
+  function initComparator() {
128
+    by = 'rating'; // Default to sort by rating.
129
+    // If the sortBy cookie is set, use that instead.
130
+    if (document.cookie.length > 0) {
131
+      var start = document.cookie.indexOf('sortBy=');
132
+      if (start != -1) {
133
+        start = start + 7;
134
+        var end = document.cookie.indexOf(";", start);
135
+        if (end == -1) {
136
+          end = document.cookie.length;
137
+          by = unescape(document.cookie.substring(start, end));
138
+        }
139
+      }
140
+    }
141
+    setComparator();
142
+  }
143
+
144
+  /**
145
+   * Show a comment div.
146
+   */
147
+  function show(id) {
148
+    $('#ao' + id).hide();
149
+    $('#ah' + id).show();
150
+    var context = $.extend({id: id}, opts);
151
+    var popup = $(renderTemplate(popupTemplate, context)).hide();
152
+    popup.find('textarea[name="proposal"]').hide();
153
+    popup.find('a.by' + by).addClass('sel');
154
+    var form = popup.find('#cf' + id);
155
+    form.submit(function(event) {
156
+      event.preventDefault();
157
+      addComment(form);
158
+    });
159
+    $('#s' + id).after(popup);
160
+    popup.slideDown('fast', function() {
161
+      getComments(id);
162
+    });
163
+  }
164
+
165
+  /**
166
+   * Hide a comment div.
167
+   */
168
+  function hide(id) {
169
+    $('#ah' + id).hide();
170
+    $('#ao' + id).show();
171
+    var div = $('#sc' + id);
172
+    div.slideUp('fast', function() {
173
+      div.remove();
174
+    });
175
+  }
176
+
177
+  /**
178
+   * Perform an ajax request to get comments for a node
179
+   * and insert the comments into the comments tree.
180
+   */
181
+  function getComments(id) {
182
+    $.ajax({
183
+     type: 'GET',
184
+     url: opts.getCommentsURL,
185
+     data: {node: id},
186
+     success: function(data, textStatus, request) {
187
+       var ul = $('#cl' + id);
188
+       var speed = 100;
189
+       $('#cf' + id)
190
+         .find('textarea[name="proposal"]')
191
+         .data('source', data.source);
192
+
193
+       if (data.comments.length === 0) {
194
+         ul.html('<li>No comments yet.</li>');
195
+         ul.data('empty', true);
196
+       } else {
197
+         // If there are comments, sort them and put them in the list.
198
+         var comments = sortComments(data.comments);
199
+         speed = data.comments.length * 100;
200
+         appendComments(comments, ul);
201
+         ul.data('empty', false);
202
+       }
203
+       $('#cn' + id).slideUp(speed + 200);
204
+       ul.slideDown(speed);
205
+     },
206
+     error: function(request, textStatus, error) {
207
+       showError('Oops, there was a problem retrieving the comments.');
208
+     },
209
+     dataType: 'json'
210
+    });
211
+  }
212
+
213
+  /**
214
+   * Add a comment via ajax and insert the comment into the comment tree.
215
+   */
216
+  function addComment(form) {
217
+    var node_id = form.find('input[name="node"]').val();
218
+    var parent_id = form.find('input[name="parent"]').val();
219
+    var text = form.find('textarea[name="comment"]').val();
220
+    var proposal = form.find('textarea[name="proposal"]').val();
221
+
222
+    if (text == '') {
223
+      showError('Please enter a comment.');
224
+      return;
225
+    }
226
+
227
+    // Disable the form that is being submitted.
228
+    form.find('textarea,input').attr('disabled', 'disabled');
229
+
230
+    // Send the comment to the server.
231
+    $.ajax({
232
+      type: "POST",
233
+      url: opts.addCommentURL,
234
+      dataType: 'json',
235
+      data: {
236
+        node: node_id,
237
+        parent: parent_id,
238
+        text: text,
239
+        proposal: proposal
240
+      },
241
+      success: function(data, textStatus, error) {
242
+        // Reset the form.
243
+        if (node_id) {
244
+          hideProposeChange(node_id);
245
+        }
246
+        form.find('textarea')
247
+          .val('')
248
+          .add(form.find('input'))
249
+          .removeAttr('disabled');
250
+	var ul = $('#cl' + (node_id || parent_id));
251
+        if (ul.data('empty')) {
252
+          $(ul).empty();
253
+          ul.data('empty', false);
254
+        }
255
+        insertComment(data.comment);
256
+        var ao = $('#ao' + node_id);
257
+        ao.find('img').attr({'src': opts.commentBrightImage});
258
+        if (node_id) {
259
+          // if this was a "root" comment, remove the commenting box
260
+          // (the user can get it back by reopening the comment popup)
261
+          $('#ca' + node_id).slideUp();
262
+        }
263
+      },
264
+      error: function(request, textStatus, error) {
265
+        form.find('textarea,input').removeAttr('disabled');
266
+        showError('Oops, there was a problem adding the comment.');
267
+      }
268
+    });
269
+  }
270
+
271
+  /**
272
+   * Recursively append comments to the main comment list and children
273
+   * lists, creating the comment tree.
274
+   */
275
+  function appendComments(comments, ul) {
276
+    $.each(comments, function() {
277
+      var div = createCommentDiv(this);
278
+      ul.append($(document.createElement('li')).html(div));
279
+      appendComments(this.children, div.find('ul.comment-children'));
280
+      // To avoid stagnating data, don't store the comments children in data.
281
+      this.children = null;
282
+      div.data('comment', this);
283
+    });
284
+  }
285
+
286
+  /**
287
+   * After adding a new comment, it must be inserted in the correct
288
+   * location in the comment tree.
289
+   */
290
+  function insertComment(comment) {
291
+    var div = createCommentDiv(comment);
292
+
293
+    // To avoid stagnating data, don't store the comments children in data.
294
+    comment.children = null;
295
+    div.data('comment', comment);
296
+
297
+    var ul = $('#cl' + (comment.node || comment.parent));
298
+    var siblings = getChildren(ul);
299
+
300
+    var li = $(document.createElement('li'));
301
+    li.hide();
302
+
303
+    // Determine where in the parents children list to insert this comment.
304
+    for(i=0; i < siblings.length; i++) {
305
+      if (comp(comment, siblings[i]) <= 0) {
306
+        $('#cd' + siblings[i].id)
307
+          .parent()
308
+          .before(li.html(div));
309
+        li.slideDown('fast');
310
+        return;
311
+      }
312
+    }
313
+
314
+    // If we get here, this comment rates lower than all the others,
315
+    // or it is the only comment in the list.
316
+    ul.append(li.html(div));
317
+    li.slideDown('fast');
318
+  }
319
+
320
+  function acceptComment(id) {
321
+    $.ajax({
322
+      type: 'POST',
323
+      url: opts.acceptCommentURL,
324
+      data: {id: id},
325
+      success: function(data, textStatus, request) {
326
+        $('#cm' + id).fadeOut('fast');
327
+        $('#cd' + id).removeClass('moderate');
328
+      },
329
+      error: function(request, textStatus, error) {
330
+        showError('Oops, there was a problem accepting the comment.');
331
+      }
332
+    });
333
+  }
334
+
335
+  function deleteComment(id) {
336
+    $.ajax({
337
+      type: 'POST',
338
+      url: opts.deleteCommentURL,
339
+      data: {id: id},
340
+      success: function(data, textStatus, request) {
341
+        var div = $('#cd' + id);
342
+        if (data == 'delete') {
343
+          // Moderator mode: remove the comment and all children immediately
344
+          div.slideUp('fast', function() {
345
+            div.remove();
346
+          });
347
+          return;
348
+        }
349
+        // User mode: only mark the comment as deleted
350
+        div
351
+          .find('span.user-id:first')
352
+          .text('[deleted]').end()
353
+          .find('div.comment-text:first')
354
+          .text('[deleted]').end()
355
+          .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
356
+                ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
357
+          .remove();
358
+        var comment = div.data('comment');
359
+        comment.username = '[deleted]';
360
+        comment.text = '[deleted]';
361
+        div.data('comment', comment);
362
+      },
363
+      error: function(request, textStatus, error) {
364
+        showError('Oops, there was a problem deleting the comment.');
365
+      }
366
+    });
367
+  }
368
+
369
+  function showProposal(id) {
370
+    $('#sp' + id).hide();
371
+    $('#hp' + id).show();
372
+    $('#pr' + id).slideDown('fast');
373
+  }
374
+
375
+  function hideProposal(id) {
376
+    $('#hp' + id).hide();
377
+    $('#sp' + id).show();
378
+    $('#pr' + id).slideUp('fast');
379
+  }
380
+
381
+  function showProposeChange(id) {
382
+    $('#pc' + id).hide();
383
+    $('#hc' + id).show();
384
+    var textarea = $('#pt' + id);
385
+    textarea.val(textarea.data('source'));
386
+    $.fn.autogrow.resize(textarea[0]);
387
+    textarea.slideDown('fast');
388
+  }
389
+
390
+  function hideProposeChange(id) {
391
+    $('#hc' + id).hide();
392
+    $('#pc' + id).show();
393
+    var textarea = $('#pt' + id);
394
+    textarea.val('').removeAttr('disabled');
395
+    textarea.slideUp('fast');
396
+  }
397
+
398
+  function toggleCommentMarkupBox(id) {
399
+    $('#mb' + id).toggle();
400
+  }
401
+
402
+  /** Handle when the user clicks on a sort by link. */
403
+  function handleReSort(link) {
404
+    var classes = link.attr('class').split(/\s+/);
405
+    for (var i=0; i<classes.length; i++) {
406
+      if (classes[i] != 'sort-option') {
407
+	by = classes[i].substring(2);
408
+      }
409
+    }
410
+    setComparator();
411
+    // Save/update the sortBy cookie.
412
+    var expiration = new Date();
413
+    expiration.setDate(expiration.getDate() + 365);
414
+    document.cookie= 'sortBy=' + escape(by) +
415
+                     ';expires=' + expiration.toUTCString();
416
+    $('ul.comment-ul').each(function(index, ul) {
417
+      var comments = getChildren($(ul), true);
418
+      comments = sortComments(comments);
419
+      appendComments(comments, $(ul).empty());
420
+    });
421
+  }
422
+
423
+  /**
424
+   * Function to process a vote when a user clicks an arrow.
425
+   */
426
+  function handleVote(link) {
427
+    if (!opts.voting) {
428
+      showError("You'll need to login to vote.");
429
+      return;
430
+    }
431
+
432
+    var id = link.attr('id');
433
+    if (!id) {
434
+      // Didn't click on one of the voting arrows.
435
+      return;
436
+    }
437
+    // If it is an unvote, the new vote value is 0,
438
+    // Otherwise it's 1 for an upvote, or -1 for a downvote.
439
+    var value = 0;
440
+    if (id.charAt(1) != 'u') {
441
+      value = id.charAt(0) == 'u' ? 1 : -1;
442
+    }
443
+    // The data to be sent to the server.
444
+    var d = {
445
+      comment_id: id.substring(2),
446
+      value: value
447
+    };
448
+
449
+    // Swap the vote and unvote links.
450
+    link.hide();
451
+    $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
452
+      .show();
453
+
454
+    // The div the comment is displayed in.
455
+    var div = $('div#cd' + d.comment_id);
456
+    var data = div.data('comment');
457
+
458
+    // If this is not an unvote, and the other vote arrow has
459
+    // already been pressed, unpress it.
460
+    if ((d.value !== 0) && (data.vote === d.value * -1)) {
461
+      $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
462
+      $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
463
+    }
464
+
465
+    // Update the comments rating in the local data.
466
+    data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
467
+    data.vote = d.value;
468
+    div.data('comment', data);
469
+
470
+    // Change the rating text.
471
+    div.find('.rating:first')
472
+      .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
473
+
474
+    // Send the vote information to the server.
475
+    $.ajax({
476
+      type: "POST",
477
+      url: opts.processVoteURL,
478
+      data: d,
479
+      error: function(request, textStatus, error) {
480
+        showError('Oops, there was a problem casting that vote.');
481
+      }
482
+    });
483
+  }
484
+
485
+  /**
486
+   * Open a reply form used to reply to an existing comment.
487
+   */
488
+  function openReply(id) {
489
+    // Swap out the reply link for the hide link
490
+    $('#rl' + id).hide();
491
+    $('#cr' + id).show();
492
+
493
+    // Add the reply li to the children ul.
494
+    var div = $(renderTemplate(replyTemplate, {id: id})).hide();
495
+    $('#cl' + id)
496
+      .prepend(div)
497
+      // Setup the submit handler for the reply form.
498
+      .find('#rf' + id)
499
+      .submit(function(event) {
500
+        event.preventDefault();
501
+        addComment($('#rf' + id));
502
+        closeReply(id);
503
+      })
504
+      .find('input[type=button]')
505
+      .click(function() {
506
+        closeReply(id);
507
+      });
508
+    div.slideDown('fast', function() {
509
+      $('#rf' + id).find('textarea').focus();
510
+    });
511
+  }
512
+
513
+  /**
514
+   * Close the reply form opened with openReply.
515
+   */
516
+  function closeReply(id) {
517
+    // Remove the reply div from the DOM.
518
+    $('#rd' + id).slideUp('fast', function() {
519
+      $(this).remove();
520
+    });
521
+
522
+    // Swap out the hide link for the reply link
523
+    $('#cr' + id).hide();
524
+    $('#rl' + id).show();
525
+  }
526
+
527
+  /**
528
+   * Recursively sort a tree of comments using the comp comparator.
529
+   */
530
+  function sortComments(comments) {
531
+    comments.sort(comp);
532
+    $.each(comments, function() {
533
+      this.children = sortComments(this.children);
534
+    });
535
+    return comments;
536
+  }
537
+
538
+  /**
539
+   * Get the children comments from a ul. If recursive is true,
540
+   * recursively include childrens' children.
541
+   */
542
+  function getChildren(ul, recursive) {
543
+    var children = [];
544
+    ul.children().children("[id^='cd']")
545
+      .each(function() {
546
+        var comment = $(this).data('comment');
547
+        if (recursive)
548
+          comment.children = getChildren($(this).find('#cl' + comment.id), true);
549
+        children.push(comment);
550
+      });
551
+    return children;
552
+  }
553
+
554
+  /** Create a div to display a comment in. */
555
+  function createCommentDiv(comment) {
556
+    if (!comment.displayed && !opts.moderator) {
557
+      return $('<div class="moderate">Thank you!  Your comment will show up '
558
+               + 'once it is has been approved by a moderator.</div>');
559
+    }
560
+    // Prettify the comment rating.
561
+    comment.pretty_rating = comment.rating + ' point' +
562
+      (comment.rating == 1 ? '' : 's');
563
+    // Make a class (for displaying not yet moderated comments differently)
564
+    comment.css_class = comment.displayed ? '' : ' moderate';
565
+    // Create a div for this comment.
566
+    var context = $.extend({}, opts, comment);
567
+    var div = $(renderTemplate(commentTemplate, context));
568
+
569
+    // If the user has voted on this comment, highlight the correct arrow.
570
+    if (comment.vote) {
571
+      var direction = (comment.vote == 1) ? 'u' : 'd';
572
+      div.find('#' + direction + 'v' + comment.id).hide();
573
+      div.find('#' + direction + 'u' + comment.id).show();
574
+    }
575
+
576
+    if (opts.moderator || comment.text != '[deleted]') {
577
+      div.find('a.reply').show();
578
+      if (comment.proposal_diff)
579
+        div.find('#sp' + comment.id).show();
580
+      if (opts.moderator && !comment.displayed)
581
+        div.find('#cm' + comment.id).show();
582
+      if (opts.moderator || (opts.username == comment.username))
583
+        div.find('#dc' + comment.id).show();
584
+    }
585
+    return div;
586
+  }
587
+
588
+  /**
589
+   * A simple template renderer. Placeholders such as <%id%> are replaced
590
+   * by context['id'] with items being escaped. Placeholders such as <#id#>
591
+   * are not escaped.
592
+   */
593
+  function renderTemplate(template, context) {
594
+    var esc = $(document.createElement('div'));
595
+
596
+    function handle(ph, escape) {
597
+      var cur = context;
598
+      $.each(ph.split('.'), function() {
599
+        cur = cur[this];
600
+      });
601
+      return escape ? esc.text(cur || "").html() : cur;
602
+    }
603
+
604
+    return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
605
+      return handle(arguments[2], arguments[1] == '%' ? true : false);
606
+    });
607
+  }
608
+
609
+  /** Flash an error message briefly. */
610
+  function showError(message) {
611
+    $(document.createElement('div')).attr({'class': 'popup-error'})
612
+      .append($(document.createElement('div'))
613
+               .attr({'class': 'error-message'}).text(message))
614
+      .appendTo('body')
615
+      .fadeIn("slow")
616
+      .delay(2000)
617
+      .fadeOut("slow");
618
+  }
619
+
620
+  /** Add a link the user uses to open the comments popup. */
621
+  $.fn.comment = function() {
622
+    return this.each(function() {
623
+      var id = $(this).attr('id').substring(1);
624
+      var count = COMMENT_METADATA[id];
625
+      var title = count + ' comment' + (count == 1 ? '' : 's');
626
+      var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
627
+      var addcls = count == 0 ? ' nocomment' : '';
628
+      $(this)
629
+        .append(
630
+          $(document.createElement('a')).attr({
631
+            href: '#',
632
+            'class': 'sphinx-comment-open' + addcls,
633
+            id: 'ao' + id
634
+          })
635
+            .append($(document.createElement('img')).attr({
636
+              src: image,
637
+              alt: 'comment',
638
+              title: title
639
+            }))
640
+            .click(function(event) {
641
+              event.preventDefault();
642
+              show($(this).attr('id').substring(2));
643
+            })
644
+        )
645
+        .append(
646
+          $(document.createElement('a')).attr({
647
+            href: '#',
648
+            'class': 'sphinx-comment-close hidden',
649
+            id: 'ah' + id
650
+          })
651
+            .append($(document.createElement('img')).attr({
652
+              src: opts.closeCommentImage,
653
+              alt: 'close',
654
+              title: 'close'
655
+            }))
656
+            .click(function(event) {
657
+              event.preventDefault();
658
+              hide($(this).attr('id').substring(2));
659
+            })
660
+        );
661
+    });
662
+  };
663
+
664
+  var opts = {
665
+    processVoteURL: '/_process_vote',
666
+    addCommentURL: '/_add_comment',
667
+    getCommentsURL: '/_get_comments',
668
+    acceptCommentURL: '/_accept_comment',
669
+    deleteCommentURL: '/_delete_comment',
670
+    commentImage: '/static/_static/comment.png',
671
+    closeCommentImage: '/static/_static/comment-close.png',
672
+    loadingImage: '/static/_static/ajax-loader.gif',
673
+    commentBrightImage: '/static/_static/comment-bright.png',
674
+    upArrow: '/static/_static/up.png',
675
+    downArrow: '/static/_static/down.png',
676
+    upArrowPressed: '/static/_static/up-pressed.png',
677
+    downArrowPressed: '/static/_static/down-pressed.png',
678
+    voting: false,
679
+    moderator: false
680
+  };
681
+
682
+  if (typeof COMMENT_OPTIONS != "undefined") {
683
+    opts = jQuery.extend(opts, COMMENT_OPTIONS);
684
+  }
685
+
686
+  var popupTemplate = '\
687
+    <div class="sphinx-comments" id="sc<%id%>">\
688
+      <p class="sort-options">\
689
+        Sort by:\
690
+        <a href="#" class="sort-option byrating">best rated</a>\
691
+        <a href="#" class="sort-option byascage">newest</a>\
692
+        <a href="#" class="sort-option byage">oldest</a>\
693
+      </p>\
694
+      <div class="comment-header">Comments</div>\
695
+      <div class="comment-loading" id="cn<%id%>">\
696
+        loading comments... <img src="<%loadingImage%>" alt="" /></div>\
697
+      <ul id="cl<%id%>" class="comment-ul"></ul>\
698
+      <div id="ca<%id%>">\
699
+      <p class="add-a-comment">Add a comment\
700
+        (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
701
+      <div class="comment-markup-box" id="mb<%id%>">\
702
+        reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
703
+        <code>``code``</code>, \
704
+        code blocks: <code>::</code> and an indented block after blank line</div>\
705
+      <form method="post" id="cf<%id%>" class="comment-form" action="">\
706
+        <textarea name="comment" cols="80"></textarea>\
707
+        <p class="propose-button">\
708
+          <a href="#" id="pc<%id%>" class="show-propose-change">\
709
+            Propose a change &#9657;\
710
+          </a>\
711
+          <a href="#" id="hc<%id%>" class="hide-propose-change">\
712
+            Propose a change &#9663;\
713
+          </a>\
714
+        </p>\
715
+        <textarea name="proposal" id="pt<%id%>" cols="80"\
716
+                  spellcheck="false"></textarea>\
717
+        <input type="submit" value="Add comment" />\
718
+        <input type="hidden" name="node" value="<%id%>" />\
719
+        <input type="hidden" name="parent" value="" />\
720
+      </form>\
721
+      </div>\
722
+    </div>';
723
+
724
+  var commentTemplate = '\
725
+    <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
726
+      <div class="vote">\
727
+        <div class="arrow">\
728
+          <a href="#" id="uv<%id%>" class="vote" title="vote up">\
729
+            <img src="<%upArrow%>" />\
730
+          </a>\
731
+          <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
732
+            <img src="<%upArrowPressed%>" />\
733
+          </a>\
734
+        </div>\
735
+        <div class="arrow">\
736
+          <a href="#" id="dv<%id%>" class="vote" title="vote down">\
737
+            <img src="<%downArrow%>" id="da<%id%>" />\
738
+          </a>\
739
+          <a href="#" id="du<%id%>" class="un vote" title="vote down">\
740
+            <img src="<%downArrowPressed%>" />\
741
+          </a>\
742
+        </div>\
743
+      </div>\
744
+      <div class="comment-content">\
745
+        <p class="tagline comment">\
746
+          <span class="user-id"><%username%></span>\
747
+          <span class="rating"><%pretty_rating%></span>\
748
+          <span class="delta"><%time.delta%></span>\
749
+        </p>\
750
+        <div class="comment-text comment"><#text#></div>\
751
+        <p class="comment-opts comment">\
752
+          <a href="#" class="reply hidden" id="rl<%id%>">reply &#9657;</a>\
753
+          <a href="#" class="close-reply" id="cr<%id%>">reply &#9663;</a>\
754
+          <a href="#" id="sp<%id%>" class="show-proposal">proposal &#9657;</a>\
755
+          <a href="#" id="hp<%id%>" class="hide-proposal">proposal &#9663;</a>\
756
+          <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
757
+          <span id="cm<%id%>" class="moderation hidden">\
758
+            <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
759
+          </span>\
760
+        </p>\
761
+        <pre class="proposal" id="pr<%id%>">\
762
+<#proposal_diff#>\
763
+        </pre>\
764
+          <ul class="comment-children" id="cl<%id%>"></ul>\
765
+        </div>\
766
+        <div class="clearleft"></div>\
767
+      </div>\
768
+    </div>';
769
+
770
+  var replyTemplate = '\
771
+    <li>\
772
+      <div class="reply-div" id="rd<%id%>">\
773
+        <form id="rf<%id%>">\
774
+          <textarea name="comment" cols="80"></textarea>\
775
+          <input type="submit" value="Add reply" />\
776
+          <input type="button" value="Cancel" />\
777
+          <input type="hidden" name="parent" value="<%id%>" />\
778
+          <input type="hidden" name="node" value="" />\
779
+        </form>\
780
+      </div>\
781
+    </li>';
782
+
783
+  $(document).ready(function() {
784
+    init();
785
+  });
786
+})(jQuery);
787
+
788
+$(document).ready(function() {
789
+  // add comment anchors for all paragraphs that are commentable
790
+  $('.sphinx-has-comment').comment();
791
+
792
+  // highlight search words in search results
793
+  $("div.context").each(function() {
794
+    var params = $.getQueryParameters();
795
+    var terms = (params.q) ? params.q[0].split(/\s+/) : [];
796
+    var result = $(this);
797
+    $.each(terms, function() {
798
+      result.highlightText(this.toLowerCase(), 'highlighted');
799
+    });
800
+  });
801
+
802
+  // directly open comment window if requested
803
+  var anchor = document.location.hash;
804
+  if (anchor.substring(0, 9) == '#comment-') {
805
+    $('#ao' + anchor.substring(9)).click();
806
+    document.location.hash = '#s' + anchor.substring(9);
807
+  }
808
+});

+ 186
- 0
_docs_/genindex.html Dosyayı Görüntüle

@@ -0,0 +1,186 @@
1
+
2
+
3
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+<html xmlns="http://www.w3.org/1999/xhtml">
7
+  <head>
8
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
+    <title>Index &#8212; stringtools  documentation</title>
10
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
11
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
12
+    <script type="text/javascript">
13
+      var DOCUMENTATION_OPTIONS = {
14
+        URL_ROOT:    './',
15
+        VERSION:     '',
16
+        COLLAPSE_INDEX: false,
17
+        FILE_SUFFIX: '.html',
18
+        HAS_SOURCE:  true,
19
+        SOURCELINK_SUFFIX: '.txt'
20
+      };
21
+    </script>
22
+    <script type="text/javascript" src="_static/jquery.js"></script>
23
+    <script type="text/javascript" src="_static/underscore.js"></script>
24
+    <script type="text/javascript" src="_static/doctools.js"></script>
25
+    <link rel="index" title="Index" href="#" />
26
+    <link rel="search" title="Search" href="search.html" />
27
+   
28
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
29
+  
30
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
31
+
32
+  </head>
33
+  <body>
34
+  
35
+
36
+    <div class="document">
37
+      <div class="documentwrapper">
38
+        <div class="bodywrapper">
39
+          <div class="body" role="main">
40
+            
41
+
42
+<h1 id="index">Index</h1>
43
+
44
+<div class="genindex-jumpbox">
45
+ <a href="#B"><strong>B</strong></a>
46
+ | <a href="#C"><strong>C</strong></a>
47
+ | <a href="#D"><strong>D</strong></a>
48
+ | <a href="#G"><strong>G</strong></a>
49
+ | <a href="#H"><strong>H</strong></a>
50
+ | <a href="#P"><strong>P</strong></a>
51
+ | <a href="#S"><strong>S</strong></a>
52
+ 
53
+</div>
54
+<h2 id="B">B</h2>
55
+<table style="width: 100%" class="indextable genindextable"><tr>
56
+  <td style="width: 33%; vertical-align: top;"><ul>
57
+      <li><a href="index.html#stringtools.csp.build_frame">build_frame() (in module stringtools.csp)</a>
58
+
59
+      <ul>
60
+        <li><a href="index.html#stringtools.stp.build_frame">(in module stringtools.stp)</a>
61
+</li>
62
+      </ul></li>
63
+  </ul></td>
64
+</tr></table>
65
+
66
+<h2 id="C">C</h2>
67
+<table style="width: 100%" class="indextable genindextable"><tr>
68
+  <td style="width: 33%; vertical-align: top;"><ul>
69
+      <li><a href="index.html#stringtools.csp.csp">csp (class in stringtools.csp)</a>
70
+</li>
71
+  </ul></td>
72
+</tr></table>
73
+
74
+<h2 id="D">D</h2>
75
+<table style="width: 100%" class="indextable genindextable"><tr>
76
+  <td style="width: 33%; vertical-align: top;"><ul>
77
+      <li><a href="index.html#stringtools.stp.DATA_CLEAR_BUFFER">DATA_CLEAR_BUFFER (in module stringtools.stp)</a>
78
+</li>
79
+      <li><a href="index.html#stringtools.stp.DATA_STORE_SYNC_VALUE">DATA_STORE_SYNC_VALUE (in module stringtools.stp)</a>
80
+</li>
81
+  </ul></td>
82
+  <td style="width: 33%; vertical-align: top;"><ul>
83
+      <li><a href="index.html#stringtools.stp.DATA_SYNC">DATA_SYNC (in module stringtools.stp)</a>
84
+</li>
85
+      <li><a href="index.html#stringtools.stp.DATA_VALID_MSG">DATA_VALID_MSG (in module stringtools.stp)</a>
86
+</li>
87
+  </ul></td>
88
+</tr></table>
89
+
90
+<h2 id="G">G</h2>
91
+<table style="width: 100%" class="indextable genindextable"><tr>
92
+  <td style="width: 33%; vertical-align: top;"><ul>
93
+      <li><a href="index.html#stringtools.gzip_compress">gzip_compress() (in module stringtools)</a>
94
+</li>
95
+  </ul></td>
96
+  <td style="width: 33%; vertical-align: top;"><ul>
97
+      <li><a href="index.html#stringtools.gzip_extract">gzip_extract() (in module stringtools)</a>
98
+</li>
99
+  </ul></td>
100
+</tr></table>
101
+
102
+<h2 id="H">H</h2>
103
+<table style="width: 100%" class="indextable genindextable"><tr>
104
+  <td style="width: 33%; vertical-align: top;"><ul>
105
+      <li><a href="index.html#stringtools.hexlify">hexlify() (in module stringtools)</a>
106
+</li>
107
+  </ul></td>
108
+</tr></table>
109
+
110
+<h2 id="P">P</h2>
111
+<table style="width: 100%" class="indextable genindextable"><tr>
112
+  <td style="width: 33%; vertical-align: top;"><ul>
113
+      <li><a href="index.html#stringtools.csp.csp.process">process() (stringtools.csp.csp method)</a>
114
+
115
+      <ul>
116
+        <li><a href="index.html#stringtools.stp.stp.process">(stringtools.stp.stp method)</a>
117
+</li>
118
+      </ul></li>
119
+  </ul></td>
120
+</tr></table>
121
+
122
+<h2 id="S">S</h2>
123
+<table style="width: 100%" class="indextable genindextable"><tr>
124
+  <td style="width: 33%; vertical-align: top;"><ul>
125
+      <li><a href="index.html#stringtools.stp.stp">stp (class in stringtools.stp)</a>
126
+</li>
127
+      <li><a href="index.html#stringtools.stp.STP_STATE_ESCAPE_1">STP_STATE_ESCAPE_1 (in module stringtools.stp)</a>
128
+</li>
129
+      <li><a href="index.html#stringtools.stp.STP_STATE_ESCAPE_2">STP_STATE_ESCAPE_2 (in module stringtools.stp)</a>
130
+</li>
131
+      <li><a href="index.html#stringtools.stp.STP_STATE_IDLE">STP_STATE_IDLE (in module stringtools.stp)</a>
132
+</li>
133
+  </ul></td>
134
+  <td style="width: 33%; vertical-align: top;"><ul>
135
+      <li><a href="index.html#stringtools.stp.STP_STATE_STORE_DATA">STP_STATE_STORE_DATA (in module stringtools.stp)</a>
136
+</li>
137
+      <li><a href="index.html#module-stringtools">stringtools (module)</a>
138
+</li>
139
+      <li><a href="index.html#module-stringtools.csp">stringtools.csp (module)</a>
140
+</li>
141
+      <li><a href="index.html#module-stringtools.stp">stringtools.stp (module)</a>
142
+</li>
143
+  </ul></td>
144
+</tr></table>
145
+
146
+
147
+
148
+          </div>
149
+        </div>
150
+      </div>
151
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
152
+        <div class="sphinxsidebarwrapper"><div class="relations">
153
+<h3>Related Topics</h3>
154
+<ul>
155
+  <li><a href="index.html">Documentation overview</a><ul>
156
+  </ul></li>
157
+</ul>
158
+</div>
159
+<div id="searchbox" style="display: none" role="search">
160
+  <h3>Quick search</h3>
161
+    <form class="search" action="search.html" method="get">
162
+      <div><input type="text" name="q" /></div>
163
+      <div><input type="submit" value="Go" /></div>
164
+      <input type="hidden" name="check_keywords" value="yes" />
165
+      <input type="hidden" name="area" value="default" />
166
+    </form>
167
+</div>
168
+<script type="text/javascript">$('#searchbox').show(0);</script>
169
+        </div>
170
+      </div>
171
+      <div class="clearer"></div>
172
+    </div>
173
+    <div class="footer">
174
+      &copy;2019, Dirk Alders.
175
+      
176
+      |
177
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
178
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
179
+      
180
+    </div>
181
+
182
+    
183
+
184
+    
185
+  </body>
186
+</html>

+ 463
- 0
_docs_/index.html Dosyayı Görüntüle

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

BIN
_docs_/objects.inv Dosyayı Görüntüle


+ 111
- 0
_docs_/py-modindex.html Dosyayı Görüntüle

@@ -0,0 +1,111 @@
1
+
2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+
5
+<html xmlns="http://www.w3.org/1999/xhtml">
6
+  <head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+    <title>Python Module Index &#8212; stringtools  documentation</title>
9
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
10
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11
+    <script type="text/javascript">
12
+      var DOCUMENTATION_OPTIONS = {
13
+        URL_ROOT:    './',
14
+        VERSION:     '',
15
+        COLLAPSE_INDEX: false,
16
+        FILE_SUFFIX: '.html',
17
+        HAS_SOURCE:  true,
18
+        SOURCELINK_SUFFIX: '.txt'
19
+      };
20
+    </script>
21
+    <script type="text/javascript" src="_static/jquery.js"></script>
22
+    <script type="text/javascript" src="_static/underscore.js"></script>
23
+    <script type="text/javascript" src="_static/doctools.js"></script>
24
+    <link rel="index" title="Index" href="genindex.html" />
25
+    <link rel="search" title="Search" href="search.html" />
26
+
27
+   
28
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
29
+  
30
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
31
+
32
+
33
+
34
+  </head>
35
+  <body>
36
+  
37
+
38
+    <div class="document">
39
+      <div class="documentwrapper">
40
+        <div class="bodywrapper">
41
+          <div class="body" role="main">
42
+            
43
+
44
+   <h1>Python Module Index</h1>
45
+
46
+   <div class="modindex-jumpbox">
47
+   <a href="#cap-s"><strong>s</strong></a>
48
+   </div>
49
+
50
+   <table class="indextable modindextable">
51
+     <tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
52
+     <tr class="cap" id="cap-s"><td></td><td>
53
+       <strong>s</strong></td><td></td></tr>
54
+     <tr>
55
+       <td><img src="_static/minus.png" class="toggler"
56
+              id="toggle-1" style="display: none" alt="-" /></td>
57
+       <td>
58
+       <a href="index.html#module-stringtools"><code class="xref">stringtools</code></a></td><td>
59
+       <em></em></td></tr>
60
+     <tr class="cg-1">
61
+       <td></td>
62
+       <td>&#160;&#160;&#160;
63
+       <a href="index.html#module-stringtools.csp"><code class="xref">stringtools.csp</code></a></td><td>
64
+       <em></em></td></tr>
65
+     <tr class="cg-1">
66
+       <td></td>
67
+       <td>&#160;&#160;&#160;
68
+       <a href="index.html#module-stringtools.stp"><code class="xref">stringtools.stp</code></a></td><td>
69
+       <em></em></td></tr>
70
+   </table>
71
+
72
+
73
+          </div>
74
+        </div>
75
+      </div>
76
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
77
+        <div class="sphinxsidebarwrapper"><div class="relations">
78
+<h3>Related Topics</h3>
79
+<ul>
80
+  <li><a href="index.html">Documentation overview</a><ul>
81
+  </ul></li>
82
+</ul>
83
+</div>
84
+<div id="searchbox" style="display: none" role="search">
85
+  <h3>Quick search</h3>
86
+    <form class="search" action="search.html" method="get">
87
+      <div><input type="text" name="q" /></div>
88
+      <div><input type="submit" value="Go" /></div>
89
+      <input type="hidden" name="check_keywords" value="yes" />
90
+      <input type="hidden" name="area" value="default" />
91
+    </form>
92
+</div>
93
+<script type="text/javascript">$('#searchbox').show(0);</script>
94
+        </div>
95
+      </div>
96
+      <div class="clearer"></div>
97
+    </div>
98
+    <div class="footer">
99
+      &copy;2019, Dirk Alders.
100
+      
101
+      |
102
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
103
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
104
+      
105
+    </div>
106
+
107
+    
108
+
109
+    
110
+  </body>
111
+</html>

+ 100
- 0
_docs_/search.html Dosyayı Görüntüle

@@ -0,0 +1,100 @@
1
+
2
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+
5
+<html xmlns="http://www.w3.org/1999/xhtml">
6
+  <head>
7
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
+    <title>Search &#8212; stringtools  documentation</title>
9
+    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
10
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11
+    <script type="text/javascript">
12
+      var DOCUMENTATION_OPTIONS = {
13
+        URL_ROOT:    './',
14
+        VERSION:     '',
15
+        COLLAPSE_INDEX: false,
16
+        FILE_SUFFIX: '.html',
17
+        HAS_SOURCE:  true,
18
+        SOURCELINK_SUFFIX: '.txt'
19
+      };
20
+    </script>
21
+    <script type="text/javascript" src="_static/jquery.js"></script>
22
+    <script type="text/javascript" src="_static/underscore.js"></script>
23
+    <script type="text/javascript" src="_static/doctools.js"></script>
24
+    <script type="text/javascript" src="_static/searchtools.js"></script>
25
+    <link rel="index" title="Index" href="genindex.html" />
26
+    <link rel="search" title="Search" href="#" />
27
+  <script type="text/javascript">
28
+    jQuery(function() { Search.loadIndex("searchindex.js"); });
29
+  </script>
30
+  
31
+  <script type="text/javascript" id="searchindexloader"></script>
32
+  
33
+   
34
+  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
35
+  
36
+  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
37
+
38
+
39
+  </head>
40
+  <body>
41
+  
42
+
43
+    <div class="document">
44
+      <div class="documentwrapper">
45
+        <div class="bodywrapper">
46
+          <div class="body" role="main">
47
+            
48
+  <h1 id="search-documentation">Search</h1>
49
+  <div id="fallback" class="admonition warning">
50
+  <script type="text/javascript">$('#fallback').hide();</script>
51
+  <p>
52
+    Please activate JavaScript to enable the search
53
+    functionality.
54
+  </p>
55
+  </div>
56
+  <p>
57
+    From here you can search these documents. Enter your search
58
+    words into the box below and click "search". Note that the search
59
+    function will automatically search for all of the words. Pages
60
+    containing fewer words won't appear in the result list.
61
+  </p>
62
+  <form action="" method="get">
63
+    <input type="text" name="q" value="" />
64
+    <input type="submit" value="search" />
65
+    <span id="search-progress" style="padding-left: 10px"></span>
66
+  </form>
67
+  
68
+  <div id="search-results">
69
+  
70
+  </div>
71
+
72
+          </div>
73
+        </div>
74
+      </div>
75
+      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
76
+        <div class="sphinxsidebarwrapper"><div class="relations">
77
+<h3>Related Topics</h3>
78
+<ul>
79
+  <li><a href="index.html">Documentation overview</a><ul>
80
+  </ul></li>
81
+</ul>
82
+</div>
83
+        </div>
84
+      </div>
85
+      <div class="clearer"></div>
86
+    </div>
87
+    <div class="footer">
88
+      &copy;2019, Dirk Alders.
89
+      
90
+      |
91
+      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.7</a>
92
+      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
93
+      
94
+    </div>
95
+
96
+    
97
+
98
+    
99
+  </body>
100
+</html>

+ 1
- 0
_docs_/searchindex.js Dosyayı Görüntüle

@@ -0,0 +1 @@
1
+Search.setIndex({docnames:["index"],envversion:52,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,Adding: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,complet: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,getlogg:0,gzip_compress:0,gzip_extract:0,hexlifi:0,identifi:0,idl:0,includ:0,index:0,insid:0,interfac:0,level:0,like:0,list:0,log:0,logger:0,messag:0,method:0,mockeri:0,modul:0,mount:0,msg:0,non:0,none:0,oper:0,option:0,out:0,output:0,page:0,paramet:0,print:0,printabl:0,process:0,receiv:0,report:0,result:0,search:0,see:0,sent:0,short_fmt:0,start:0,state:0,stdout: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,streamhandl:0,string:0,stringexampl:0,submodul:0,sudo:0,support:0,sync:0,sys:0,thi: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}})

+ 13956
- 0
_testresults_/unittest.json
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


BIN
_testresults_/unittest.pdf Dosyayı Görüntüle


+ 89
- 0
csp.py Dosyayı Görüntüle

@@ -0,0 +1,89 @@
1
+#!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+#
4
+"""
5
+csp (Carriage-Return seperation protocol)
6
+=========================================
7
+
8
+**Author:**
9
+
10
+* Dirk Alders <sudo-dirk@mount-mockery.de>
11
+
12
+**Description:**
13
+
14
+    This module is a submodule of :mod:`stringtools` and creates an frame to transmit and receive messages via an serial interface.
15
+
16
+**Submodules:**
17
+
18
+* :class:`stringtools.csp.csp`
19
+* :func:`stringtools.csp.build_frame`
20
+"""
21
+
22
+import stringtools
23
+
24
+import logging
25
+import sys
26
+
27
+logger_name = 'STRINGTOOLS'
28
+logger = logging.getLogger(logger_name)
29
+
30
+DATA_SEPERATOR = b'\n'
31
+
32
+
33
+class csp(object):
34
+    """This class extracts messages from an "csp-stream".
35
+
36
+    **Example:**
37
+
38
+    .. literalinclude:: ../examples/csp.csp.py
39
+
40
+    Will result to the following output:
41
+
42
+    .. literalinclude:: ../examples/csp.csp.log
43
+    """
44
+    LOG_PREFIX = 'CSP:'
45
+
46
+    def __init__(self, seperator=DATA_SEPERATOR):
47
+        self.__buffer__ = b''
48
+        self.__seperator__ = seperator
49
+
50
+    def process(self, data):
51
+        """
52
+        This processes a byte out of a "stp-stream".
53
+
54
+        :param bytes data: A byte stream
55
+        :returns: A list of the extracted message(s)
56
+        :rtype: list
57
+        """
58
+        if sys.version_info < (3, 0):
59
+            if type(data) is unicode:
60
+                raise TypeError
61
+        #
62
+        rv = (self.__buffer__ + data).split(self.__seperator__)
63
+        self.__buffer__ = rv.pop()
64
+        if len(self.__buffer__) != 0:
65
+            logger.debug('%s Leaving data in buffer (to be processed next time): %s', self.LOG_PREFIX, stringtools.hexlify(self.__buffer__))
66
+        for msg in rv:
67
+            logger.info('%s message identified - %s', self.LOG_PREFIX, stringtools.hexlify(msg))
68
+        return rv
69
+
70
+
71
+def build_frame(msg, seperator=DATA_SEPERATOR):
72
+    """This Method builds an "csp-frame" to be transfered via a stream.
73
+
74
+    :param str data: A String (Bytes) to be framed
75
+    :returns: The "csp-framed" message to be sent
76
+    :rtype: str
77
+
78
+    **Example:**
79
+
80
+    .. literalinclude:: ../examples/csp.build_frame.py
81
+
82
+    Will result to the following output:
83
+
84
+    .. literalinclude:: ../examples/csp.build_frame.log
85
+    """
86
+    if seperator in msg:
87
+        raise ValueError
88
+    else:
89
+        return msg + seperator

+ 175
- 0
stp.py Dosyayı Görüntüle

@@ -0,0 +1,175 @@
1
+#!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+#
4
+"""
5
+stp (Serial transfer protocol)
6
+==============================
7
+
8
+**Author:**
9
+
10
+* Dirk Alders <sudo-dirk@mount-mockery.de>
11
+
12
+**Description:**
13
+
14
+    This module is a submodule of :mod:`stringtools` and creates an serial frame to transmit and receive messages via an serial interface.
15
+
16
+**Submodules:**
17
+
18
+* :class:`stringtools.stp.stp`
19
+* :func:`stringtools.stp.build_frame`
20
+"""
21
+
22
+import stringtools
23
+
24
+import logging
25
+import sys
26
+
27
+logger_name = 'STRINGTOOLS'
28
+logger = logging.getLogger(logger_name)
29
+
30
+DATA_SYNC = b'\x3a'
31
+"""The data sync byte"""
32
+DATA_CLEAR_BUFFER = b'\x3c'
33
+"""The clear buffer byte ('\\\\x3a\\\\x3c' -> start of message)"""
34
+DATA_VALID_MSG = b'\x3e'
35
+"""The valid message byte ('\\\\x3a\\\\x3e' -> end of message)"""
36
+DATA_STORE_SYNC_VALUE = b'\x3d'
37
+"""The store sync value byte ('\\\\x3a\\\\x3d' -> '\\\\x3a' inside a message)"""
38
+
39
+STP_STATE_IDLE = 0x00
40
+"""Idle state definition (default)"""
41
+STP_STATE_ESCAPE_1 = 0x01
42
+"""Escape 1 state definition ('\\\\x3a\\\\x3c' found)"""
43
+STP_STATE_ESCAPE_2 = 0x02
44
+"""Escape 2 state definition ('\\\\x3a' found inside a message)"""
45
+STP_STATE_STORE_DATA = 0x03
46
+"""Store data state definition (start of message found; data will be stored)"""
47
+
48
+
49
+class stp(object):
50
+    """This class extracts messages from an "stp-stream".
51
+
52
+    **Example:**
53
+
54
+    .. literalinclude:: ../examples/stp.stp.py
55
+
56
+    Will result to the following output:
57
+
58
+    .. literalinclude:: ../examples/stp.stp.log
59
+    """
60
+    LOG_PREFIX = 'STP:'
61
+
62
+    def __init__(self):
63
+        self.state = STP_STATE_IDLE
64
+        self.__buffer__ = b''
65
+        self.__clear_buffer__()
66
+
67
+    def __clear_buffer__(self):
68
+        if len(self.__buffer__) > 0:
69
+            logger.warning('%s Chunking "%s" from buffer', self.LOG_PREFIX, stringtools.hexlify(self.__buffer__))
70
+        self.__buffer__ = b''
71
+
72
+    def process(self, data):
73
+        """
74
+        This processes a byte out of a "stp-stream".
75
+
76
+        :param bytes data: A byte stream
77
+        :returns: The extracted message or None, if no message is identified yet
78
+        :rtype: str
79
+        """
80
+        if type(data) is list:
81
+            raise TypeError
82
+        if sys.version_info <= (3, 0):
83
+            if type(data) is unicode:
84
+                raise TypeError
85
+        #
86
+        rv = []
87
+        #
88
+        while len(data) > 0:
89
+            if sys.version_info >= (3, 0):
90
+                b = bytes([data[0]])
91
+            else:
92
+                b = data[0]
93
+            data = data[1:]
94
+            #
95
+            if self.state == STP_STATE_IDLE:
96
+                if b == DATA_SYNC:
97
+                    self.state = STP_STATE_ESCAPE_1
98
+                    logger.debug('%s data sync (%02x) received => changing state STP_STATE_IDLE -> STP_STATE_ESCAPE_1', self.LOG_PREFIX, ord(b))
99
+                else:
100
+                    logger.warning('%s no data sync (%02x) received => ignoring byte', self.LOG_PREFIX, ord(b))
101
+            elif self.state == STP_STATE_ESCAPE_1:
102
+                if b == DATA_CLEAR_BUFFER:
103
+                    logger.debug('%s start pattern (%02x %02x) received => changing state STP_STATE_ESCAPE_1 -> STP_STATE_STORE_DATA', self.LOG_PREFIX, ord(DATA_SYNC), ord(b))
104
+                    self.state = STP_STATE_STORE_DATA
105
+                    self.__clear_buffer__()
106
+                elif b != DATA_SYNC:
107
+                    self.state = STP_STATE_IDLE
108
+                    logger.warning('%s no start pattern (%02x %02x) received => changing state STP_STATE_ESCAPE_1 -> STP_STATE_IDLE', self.LOG_PREFIX, ord(DATA_SYNC), ord(b))
109
+                else:
110
+                    logger.warning('%s 2nd data sync (%02x) received => keep state', self.LOG_PREFIX, ord(b))
111
+            elif self.state == STP_STATE_STORE_DATA:
112
+                if b == DATA_SYNC:
113
+                    self.state = STP_STATE_ESCAPE_2
114
+                    logger.debug('%s data sync (%02x) received => changing state STP_STATE_STORE_DATA -> STP_STATE_ESCAPE_2', self.LOG_PREFIX, ord(b))
115
+                else:
116
+                    self.__buffer__ += b
117
+            elif self.state == STP_STATE_ESCAPE_2:
118
+                if b == DATA_CLEAR_BUFFER:
119
+                    logger.warning('%s start pattern (%02x %02x) received => changing state STP_STATE_ESCAPE_2 -> STP_STATE_STORE_DATA', self.LOG_PREFIX, ord(DATA_SYNC), ord(b))
120
+                    self.state = STP_STATE_STORE_DATA
121
+                    self.__clear_buffer__()
122
+                elif b == DATA_VALID_MSG:
123
+                    self.state = STP_STATE_IDLE
124
+                    logger.debug('%s end pattern (%02x %02x) received => storing message and changing state STP_STATE_ESCAPE_2 -> STP_STATE_IDLE', self.LOG_PREFIX, ord(DATA_SYNC), ord(b))
125
+                    rv.append(self.__buffer__)
126
+                    self.__buffer__ = b''
127
+                elif b == DATA_STORE_SYNC_VALUE:
128
+                    self.state = STP_STATE_STORE_DATA
129
+                    logger.debug('%s store sync pattern (%02x %02x) received => changing state STP_STATE_ESCAPE_2 -> STP_STATE_STORE_DATA', self.LOG_PREFIX, ord(DATA_SYNC), ord(b))
130
+                    self.__buffer__ += DATA_SYNC
131
+                elif b == DATA_SYNC:
132
+                    self.state = STP_STATE_ESCAPE_1
133
+                    logger.warning('%s second data sync (%02x) received => changing state STP_STATE_ESCAPE_2 -> STP_STATE_ESCAPE_1', self.LOG_PREFIX, ord(b))
134
+                    self.__clear_buffer__()
135
+                else:
136
+                    self.state = STP_STATE_IDLE
137
+                    logger.warning('%s data (%02x) received => changing state STP_STATE_ESCAPE_2 -> STP_STATE_IDLE', self.LOG_PREFIX, ord(b))
138
+                    self.__clear_buffer__()
139
+            else:
140
+                logger.error('%s unknown state (%s) => adding value (%02x) back to data again and changing state -> STP_STATE_IDLE', self.LOG_PREFIX, repr(self.state), ord(b))
141
+                self.state = STP_STATE_IDLE
142
+                self.__clear_buffer__()
143
+                data = b + data
144
+        for msg in rv:
145
+            logger.info('%s message identified - %s', self.LOG_PREFIX, stringtools.hexlify(msg))
146
+        return rv
147
+
148
+
149
+def build_frame(data):
150
+    """This Method builds an "stp-frame" to be transfered via a stream.
151
+
152
+    :param str data: A String (Bytes) to be framed
153
+    :returns: The "stp-framed" message to be sent
154
+    :rtype: str
155
+
156
+    **Example:**
157
+
158
+    .. literalinclude:: ../examples/stp.build_frame.py
159
+
160
+    Will result to the following output:
161
+
162
+    .. literalinclude:: ../examples/stp.build_frame.log
163
+    """
164
+    rv = DATA_SYNC + DATA_CLEAR_BUFFER
165
+
166
+    for byte in data:
167
+        if sys.version_info >= (3, 0):
168
+            byte = bytes([byte])
169
+        if byte == DATA_SYNC:
170
+            rv += DATA_SYNC + DATA_STORE_SYNC_VALUE
171
+        else:
172
+            rv += byte
173
+
174
+    rv += DATA_SYNC + DATA_VALID_MSG
175
+    return rv

Loading…
İptal
Kaydet