瀏覽代碼

helpers documentation and minor update and fixes

master
Dirk Alders 4 年之前
父節點
當前提交
4be70cfef8
共有 97 個檔案被更改,包括 21279 行新增40 行删除
  1. 411
    40
      __init__.py
  2. 4
    0
      _docs_/.buildinfo
  3. 0
    0
      _docs_/_downloads/fc87e95cc505cb0c7a476506dac46609/unittest.pdf
  4. 23
    0
      _docs_/_sources/index.rst.txt
  5. 676
    0
      _docs_/_static/basic.css
  6. 1
    0
      _docs_/_static/css/badge_only.css
  7. 二進制
      _docs_/_static/css/fonts/Roboto-Slab-Bold.woff
  8. 二進制
      _docs_/_static/css/fonts/Roboto-Slab-Bold.woff2
  9. 二進制
      _docs_/_static/css/fonts/Roboto-Slab-Regular.woff
  10. 二進制
      _docs_/_static/css/fonts/Roboto-Slab-Regular.woff2
  11. 二進制
      _docs_/_static/css/fonts/fontawesome-webfont.eot
  12. 2671
    0
      _docs_/_static/css/fonts/fontawesome-webfont.svg
  13. 二進制
      _docs_/_static/css/fonts/fontawesome-webfont.ttf
  14. 二進制
      _docs_/_static/css/fonts/fontawesome-webfont.woff
  15. 二進制
      _docs_/_static/css/fonts/fontawesome-webfont.woff2
  16. 二進制
      _docs_/_static/css/fonts/lato-bold-italic.woff
  17. 二進制
      _docs_/_static/css/fonts/lato-bold-italic.woff2
  18. 二進制
      _docs_/_static/css/fonts/lato-bold.woff
  19. 二進制
      _docs_/_static/css/fonts/lato-bold.woff2
  20. 二進制
      _docs_/_static/css/fonts/lato-normal-italic.woff
  21. 二進制
      _docs_/_static/css/fonts/lato-normal-italic.woff2
  22. 二進制
      _docs_/_static/css/fonts/lato-normal.woff
  23. 二進制
      _docs_/_static/css/fonts/lato-normal.woff2
  24. 4
    0
      _docs_/_static/css/theme.css
  25. 315
    0
      _docs_/_static/doctools.js
  26. 10
    0
      _docs_/_static/documentation_options.js
  27. 二進制
      _docs_/_static/file.png
  28. 二進制
      _docs_/_static/fonts/FontAwesome.otf
  29. 二進制
      _docs_/_static/fonts/Lato/lato-bold.eot
  30. 二進制
      _docs_/_static/fonts/Lato/lato-bold.ttf
  31. 二進制
      _docs_/_static/fonts/Lato/lato-bold.woff
  32. 二進制
      _docs_/_static/fonts/Lato/lato-bold.woff2
  33. 二進制
      _docs_/_static/fonts/Lato/lato-bolditalic.eot
  34. 二進制
      _docs_/_static/fonts/Lato/lato-bolditalic.ttf
  35. 二進制
      _docs_/_static/fonts/Lato/lato-bolditalic.woff
  36. 二進制
      _docs_/_static/fonts/Lato/lato-bolditalic.woff2
  37. 二進制
      _docs_/_static/fonts/Lato/lato-italic.eot
  38. 二進制
      _docs_/_static/fonts/Lato/lato-italic.ttf
  39. 二進制
      _docs_/_static/fonts/Lato/lato-italic.woff
  40. 二進制
      _docs_/_static/fonts/Lato/lato-italic.woff2
  41. 二進制
      _docs_/_static/fonts/Lato/lato-regular.eot
  42. 二進制
      _docs_/_static/fonts/Lato/lato-regular.ttf
  43. 二進制
      _docs_/_static/fonts/Lato/lato-regular.woff
  44. 二進制
      _docs_/_static/fonts/Lato/lato-regular.woff2
  45. 二進制
      _docs_/_static/fonts/Roboto-Slab-Bold.woff
  46. 二進制
      _docs_/_static/fonts/Roboto-Slab-Bold.woff2
  47. 二進制
      _docs_/_static/fonts/Roboto-Slab-Light.woff
  48. 二進制
      _docs_/_static/fonts/Roboto-Slab-Light.woff2
  49. 二進制
      _docs_/_static/fonts/Roboto-Slab-Regular.woff
  50. 二進制
      _docs_/_static/fonts/Roboto-Slab-Regular.woff2
  51. 二進制
      _docs_/_static/fonts/Roboto-Slab-Thin.woff
  52. 二進制
      _docs_/_static/fonts/Roboto-Slab-Thin.woff2
  53. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot
  54. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf
  55. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff
  56. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2
  57. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot
  58. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf
  59. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff
  60. 二進制
      _docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2
  61. 二進制
      _docs_/_static/fonts/fontawesome-webfont.eot
  62. 2671
    0
      _docs_/_static/fonts/fontawesome-webfont.svg
  63. 二進制
      _docs_/_static/fonts/fontawesome-webfont.ttf
  64. 二進制
      _docs_/_static/fonts/fontawesome-webfont.woff
  65. 二進制
      _docs_/_static/fonts/fontawesome-webfont.woff2
  66. 二進制
      _docs_/_static/fonts/lato-bold-italic.woff
  67. 二進制
      _docs_/_static/fonts/lato-bold-italic.woff2
  68. 二進制
      _docs_/_static/fonts/lato-bold.woff
  69. 二進制
      _docs_/_static/fonts/lato-bold.woff2
  70. 二進制
      _docs_/_static/fonts/lato-normal-italic.woff
  71. 二進制
      _docs_/_static/fonts/lato-normal-italic.woff2
  72. 二進制
      _docs_/_static/fonts/lato-normal.woff
  73. 二進制
      _docs_/_static/fonts/lato-normal.woff2
  74. 10365
    0
      _docs_/_static/jquery.js
  75. 1
    0
      _docs_/_static/js/badge_only.js
  76. 4
    0
      _docs_/_static/js/html5shiv-printshiv.min.js
  77. 4
    0
      _docs_/_static/js/html5shiv.min.js
  78. 4
    0
      _docs_/_static/js/modernizr.min.js
  79. 1
    0
      _docs_/_static/js/theme.js
  80. 297
    0
      _docs_/_static/language_data.js
  81. 二進制
      _docs_/_static/minus.png
  82. 二進制
      _docs_/_static/plus.png
  83. 69
    0
      _docs_/_static/pygments.css
  84. 481
    0
      _docs_/_static/searchtools.js
  85. 1692
    0
      _docs_/_static/underscore.js
  86. 340
    0
      _docs_/genindex.html
  87. 724
    0
      _docs_/index.html
  88. 5
    0
      _docs_/objects.inv
  89. 216
    0
      _docs_/py-modindex.html
  90. 214
    0
      _docs_/search.html
  91. 1
    0
      _docs_/searchindex.js
  92. 11
    0
      _examples_/Makefile
  93. 10
    0
      _examples_/continues_statistic.py
  94. 19
    0
      _examples_/continues_statistic_multivalue.py
  95. 21
    0
      _examples_/direct_socket.py
  96. 14
    0
      _examples_/ringbuffer.py
  97. 0
    0
      _testresults_/unittest.pdf

+ 411
- 40
__init__.py 查看文件

@@ -1,8 +1,42 @@
1
+#!/usr/bin/env python
2
+# -*- coding: utf-8 -*-
3
+#
4
+"""
5
+helpers (Helpers)
6
+=================
7
+
8
+**Author:**
9
+
10
+* Dirk Alders <sudo-dirk@mount-mockery.de>
11
+
12
+**Description:**
13
+
14
+    This module supports functions and classes which don't have an own Module (yet).
15
+
16
+**Submodules:**
17
+
18
+* :class:`helpers.continues_statistic`
19
+* :class:`helpers.continues_statistic_multivalue`
20
+* :class:`helpers.direct_socket_client`
21
+* :class:`helpers.direct_socket_server`
22
+* :class:`helpers.ringbuffer`
23
+
24
+**Unittest:**
25
+
26
+    See also the :download:`unittest <helpers/_testresults_/unittest.pdf>` documentation.
27
+
28
+**Module Documentation:**
29
+
30
+"""
1 31
 import logging
2 32
 import numbers
3 33
 import os
4 34
 import time
5 35
 
36
+import stringtools
37
+import task
38
+__DEPENDENCIES__ = ['stringtools', 'task', ]
39
+
6 40
 try:
7 41
     from config import APP_NAME as ROOT_LOGGER_NAME
8 42
 except ImportError:
@@ -11,12 +45,47 @@ except ImportError:
11 45
 logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
12 46
 
13 47
 
48
+__DESCRIPTION__ = """The Module {\\tt %s} is designed to help with some function which don't have an own Module (yet).
49
+For more Information read the documentation.""" % __name__.replace('_', '\_')
50
+"""The Module Description"""
51
+__INTERPRETER__ = (2, 3)
52
+"""The Tested Interpreter-Versions"""
53
+
54
+
14 55
 class continues_statistic(dict):
15
-    def __init__(self, mean=None, min_val=None, max_val=None, quantifier=None):
56
+    """
57
+    This class stores a statistic for a stream of values. The statistic includes: mean, min, max, quantifier.
58
+
59
+    .. note:: You can use the mathematic operators "+, +=" to add a value to the statistic.
60
+
61
+    :param mean: The mean start value, the start value or None.
62
+    :type mean: numeric
63
+    :param min_val: The min start value or None
64
+    :type min_val: numeric
65
+    :param max_val: The max start value or None
66
+    :type max_val: numeric
67
+    :param quantifier: The quantifier start value or 0
68
+    :type quantifier: int
69
+
70
+    .. note:: You are able to initialise this class in the following ways:
71
+
72
+              * Without arguments to get an empty instance
73
+              * With one single value to get an starting instance
74
+              * With mean, min_val, max_val, quantifier to initialise an existing statistic
75
+
76
+    **Example:**
77
+
78
+    .. literalinclude:: helpers/_examples_/continues_statistic.py
79
+
80
+    Will result to the following output:
81
+
82
+    .. literalinclude:: helpers/_examples_/continues_statistic.log
83
+    """
84
+    def __init__(self, mean=None, min_val=None, max_val=None, quantifier=0):
16 85
         dict.__init__(self)
17 86
         if mean is None:
18
-            self.__init_data__(None, None, None, None)
19
-        elif min_val is not None and max_val is not None and quantifier is not None:
87
+            self.__init_data__(None, None, None, 0)
88
+        elif min_val is not None and max_val is not None and quantifier > 0:
20 89
             self.__init_data__(mean, min_val, max_val, quantifier)
21 90
         else:
22 91
             self.__init_data__(mean, mean, mean, 1)
@@ -27,78 +96,375 @@ class continues_statistic(dict):
27 96
         self['min_val'] = min_val
28 97
         self['mean'] = mean
29 98
 
30
-    def expand(self, value):
31
-        if self['quantifier'] is None:
32
-            self.__init_data__(value, value, value, 1)
33
-        else:
34
-            cs_sum = self + continues_statistic(value)
35
-            for key in self:
36
-                self[key] = cs_sum[key]
37
-
38 99
     def __add__(self, other):
39
-        rv = continues_statistic()
40
-        rv['mean'] = (self.mean * self.quantifier + other.mean * other.quantifier) / (self.quantifier + other.quantifier)
41
-        rv['min_val'] = min(self.min, other.min)
42
-        rv['max_val'] = max(self.max, other.max)
43
-        rv['quantifier'] = self.quantifier + other.quantifier
44
-        return rv
100
+        if self.quantifier == 0:
101
+            return continues_statistic(**other)
102
+        elif other.quantifier == 0:
103
+            return continues_statistic(**self)
104
+        else:
105
+            return continues_statistic(
106
+                mean=(self.mean * self.quantifier + other.mean * other.quantifier) / (self.quantifier + other.quantifier),
107
+                min_val=min(self.min, other.min),
108
+                max_val=max(self.max, other.max),
109
+                quantifier=self.quantifier + other.quantifier,
110
+            )
45 111
 
46 112
     @property
47 113
     def mean(self):
114
+        """
115
+        The current mean value.
116
+        """
48 117
         return self.get('mean')
49 118
 
50 119
     @property
51 120
     def min(self):
121
+        """
122
+        The current min value.
123
+        """
52 124
         return self.get('min_val')
53 125
 
54 126
     @property
55 127
     def max(self):
128
+        """
129
+        The current max value.
130
+        """
56 131
         return self.get('max_val')
57 132
 
58 133
     @property
59 134
     def quantifier(self):
135
+        """
136
+        The current quantifier (number of values for continues statistic).
137
+        """
60 138
         return self.get('quantifier')
61 139
 
62 140
     def pop(self):
63
-        rv = continues_statistic(self.mean, self.min, self.max, self.quantifier)
64
-        self.__init_data__(None, None, None, None)
65
-        return rv
141
+        """
142
+        This pops out the current statistic data and returns these as an instance of :class:`helpers.continues_statistic`.
143
+
144
+        :returns: The current statistic or None, if no value is available.
145
+        :rtype: :class:`helpers.continues_statistic` or None
146
+        """
147
+        if self.quantifier == 0:
148
+            return None
149
+        else:
150
+            rv = continues_statistic(self.mean, self.min, self.max, self.quantifier)
151
+            self.__init_data__(None, None, None, 0)
152
+            return rv
66 153
 
67 154
     def __str__(self):
68 155
         return "mean=%(mean)s, min=%(min_val)s, max=%(max_val)s, quantifier=%(quantifier)s" % self
69 156
 
70 157
 
71 158
 class continues_statistic_multivalue(dict):
72
-    def __init__(self, **kwargs):
159
+    """
160
+    This class stores multiple statistics of stream values. The statistic of each value is stored as :class:`helpers.continues_statistic`.
161
+
162
+    .. note:: You can use the mathematic operators "+, +=" to add instances.
163
+
164
+    .. note:: You are able to initialise this class in the following ways:
165
+
166
+              * Without arguments to get an empty instance
167
+              * With a keword argument(s) which will be passed to :class:`continues_statistic`
168
+              * With a dict equivalent of :class:`continues_statistic_multivalue` to initialise an existing statistic
169
+
170
+    **Example:**
171
+
172
+    .. literalinclude:: helpers/_examples_/continues_statistic_multivalue.py
173
+
174
+    Will result to the following output:
175
+
176
+    .. literalinclude:: helpers/_examples_/continues_statistic_multivalue.log
177
+    """
178
+    def __init__(self, *args, **kwargs):
73 179
         dict.__init__(self)
74
-        for key in kwargs:
75
-            if type(kwargs[key]) is continues_statistic:
76
-                self[key] = kwargs[key]
77
-            elif type(kwargs[key]) is dict:
78
-                self[key] = continues_statistic(**kwargs[key])
79
-            else:
80
-                self[key] = continues_statistic(kwargs[key])
180
+        if len(args) == 0 and len(kwargs) >= 0:
181
+            for key in kwargs:
182
+                if type(kwargs[key]) is continues_statistic:
183
+                    self[key] = kwargs[key]
184
+                elif type(kwargs[key]) is dict:
185
+                    self[key] = continues_statistic(**kwargs[key])
186
+                else:
187
+                    self[key] = continues_statistic(kwargs[key])
188
+        elif len(args) == 1 and len(kwargs) == 0:
189
+            for key in args[0]:
190
+                self[key] = continues_statistic(**args[0][key])
191
+        else:
192
+            raise TypeError("No valid initialisation value(s)!")
81 193
 
82
-    def expand(self, **kwargs):
83
-        for key in kwargs:
84
-            if key in self:
85
-                self[key].expand(kwargs[key])
86
-            else:
87
-                self[key] = continues_statistic(kwargs[key])
194
+    def __add__(self, other):
195
+        rv_dict = {}
196
+        for key in set(list(self.keys()) + list(other.keys())):
197
+            rv_dict[key] = self.get(key, continues_statistic()) + other.get(key, continues_statistic())
198
+        return continues_statistic_multivalue(**rv_dict)
88 199
 
89 200
     def pop(self, key=None):
201
+        """
202
+        This pops out the current statistic data for a given key and returns these as an instance of :class:`helpers.continues_statistic`.
203
+
204
+        If no key is given it pops out the current statistic data and returns these as an instance of :class:`helpers.continues_statistic_multiple`.
205
+
206
+        :param key: The key to get data for
207
+        :type key: str or NoneType
208
+
209
+        :returns: The current statistic or None, if no value is available.
210
+        :rtype: :class:`helpers.continues_statistic` or None
211
+        """
90 212
         if key is None:
91
-            rv = continues_statistic_multivalue(**self)
92
-            self.clear()
93
-            return rv
213
+            if len(self) == 0:
214
+                return None
215
+            else:
216
+                rv = continues_statistic_multivalue(**self)
217
+                self.clear()
218
+                return rv
94 219
         else:
95 220
             return self[key].pop()
96 221
 
97 222
     def __str__(self):
98
-        return '\n'.join([key + ': ' + str(self[key]) for key in self])
223
+        if len(self) == 0:
224
+            return '-'
225
+        else:
226
+            return '\n'.join([key + ': ' + str(self[key]) for key in self])
227
+
228
+
229
+class direct_socket_base(object):
230
+    """
231
+    This is the base class for other classes in this module.
232
+    """
233
+    DEFAULT_CHANNEL_NAME = 'all_others'
234
+
235
+    def __init__(self, max_len=None, virtual_rate_bps=None):
236
+        self.__max_length__ = max_len
237
+        self.__rate_bps__ = virtual_rate_bps
238
+        #
239
+        self.init_channel_name()
240
+        self.__queue__ = task.threaded_queue()
241
+        self.__queue__.run()
242
+        #
243
+        self.__remote_socket__ = None
244
+        self.__last_remote_socket__ = None
245
+        self.__data_callback__ = None
246
+        self.__connect_callback__ = None
247
+        self.__disconnect_callback__ = None
248
+        #
249
+        self.__clean_buffer__()
250
+
251
+    def __chunks__(self, data):
252
+        chunks = []
253
+        if self.__max_length__ is None:
254
+            chunks.append(data)
255
+        else:
256
+            for i in range(0, len(data), self.__max_length__):
257
+                chunks.append(data[i:i + self.__max_length__])
258
+        return chunks
259
+
260
+    def __clean_buffer__(self):
261
+        self.__rx_buffer__ = b''
262
+        self.logger.info('%s Cleaning RX-Buffer...', self.__log_prefix__())
263
+
264
+    def __connect__(self, remote_socket):
265
+        if self.__remote_socket__ is None:
266
+            self.__remote_socket__ = remote_socket
267
+            self.logger.info('%s Connection established...', self.__log_prefix__())
268
+            self.__clean_buffer__()
269
+            if self.__connect_callback__ is not None:
270
+                self.__connect_callback__()
271
+            remote_socket.__connect__(self)
272
+
273
+    def __log_prefix__(self):
274
+        return 'Client:' if self.IS_CLIENT else 'Server:'
275
+
276
+    def __rx__(self, data):
277
+        self.__rx_buffer__ += data
278
+        self.logger.debug('%s RX <- %s', self.__log_prefix__(), stringtools.hexlify(data))
279
+        if self.__data_callback__ is not None:
280
+            self.__data_callback__(self)
281
+
282
+    def __tx__(self, q, data):
283
+        self.logger.debug('%s TX -> %s', self.__log_prefix__(), stringtools.hexlify(data))
284
+        if self.__rate_bps__ is not None:
285
+            time.sleep(len(data) / self.__rate_bps__)
286
+        self.__remote_socket__.__rx__(data)
287
+
288
+    def disconnect(self):
289
+        """
290
+        Method to disconnect client and server.
291
+        """
292
+        if self.__remote_socket__ is not None:
293
+            self.__last_remote_socket__ = self.__remote_socket__
294
+            self.__remote_socket__ = None
295
+            self.logger.info('%s Connection Lost...', self.__log_prefix__())
296
+            if self.__disconnect_callback__ is not None:
297
+                self.__disconnect_callback__()
298
+            self.__last_remote_socket__.disconnect()
299
+
300
+    def init_channel_name(self, channel_name=None):
301
+        """
302
+        With this Method, the channel name for logging can be changed.
303
+
304
+        :param channel_name: The name for the logging channel
305
+        :type channel_name: str
306
+        """
307
+        if channel_name is None:
308
+            self.logger = logger.getChild(self.DEFAULT_CHANNEL_NAME)
309
+        else:
310
+            self.logger = logger.getChild(channel_name)
311
+
312
+    def is_connected(self):
313
+        """
314
+        With this Method the connection status can be identified.
315
+
316
+        :return: True, if a connection is established, otherwise False.
317
+        :rtype: bool
318
+        """
319
+        return self.__remote_socket__ is not None
320
+
321
+    def receive(self, timeout=1.0, num=None):
322
+        """
323
+        This method returns received data.
324
+
325
+        :param timeout: The timeout for receiving data (at least after the timeout the method returns data or None).
326
+        :type timeout: float
327
+        :param num: the number of bytes to receive (use None to get all available data).
328
+        :type num: int or None
329
+        :return: The received data.
330
+        :rtype: bytes
331
+        """
332
+        i = 0
333
+        while len(self.__rx_buffer__) < (num or 1) and i < timeout * 10:
334
+            i += 1
335
+            time.sleep(.1)
336
+        if len(self.__rx_buffer__) < (num or 1):
337
+            return b''
338
+        else:
339
+            if num is None:
340
+                rv = self.__rx_buffer__
341
+                self.__rx_buffer__ = b''
342
+            else:
343
+                rv = self.__rx_buffer__[:num]
344
+                self.__rx_buffer__ = self.__rx_buffer__[num:]
345
+            return rv
346
+
347
+    def register_callback(self, callback):
348
+        """
349
+        This method stores the callback which is executed, if data is available. You need to execute :func:`receive` of this instance
350
+        given as first argument.
351
+
352
+        :param callback: The callback which will be executed, when data is available.
353
+        :type callback:
354
+        """
355
+        self.__data_callback__ = callback
356
+
357
+    def register_connect_callback(self, callback):
358
+        """
359
+        This method stores the callback which is executed, if a connection is established.
360
+
361
+        :param callback: The callback which will be executed, when a connection is established.
362
+        :type callback:
363
+        """
364
+        self.__connect_callback__ = callback
365
+
366
+    def register_disconnect_callback(self, callback):
367
+        """
368
+        This method stores the callback which is executed, after the connection is lost.
369
+
370
+        :param callback: The callback which will be executed, after the connection is lost.
371
+        :type callback:
372
+        """
373
+        self.__disconnect_callback__ = callback
374
+
375
+    def send(self, data, timeout=1.0):
376
+        """
377
+        This method sends data via the initiated communication channel.
378
+
379
+        :param data: The data to be send over the communication channel.
380
+        :type data: bytes
381
+        :param timeout: The timeout for sending data (e.g. time to establish new connection).
382
+        :type timeout: float
383
+        :param log_lvl: The log level to log outgoing TX-data
384
+        :type log_lvl: int
385
+        :return: True if data had been sent, otherwise False.
386
+        :rtype: bool
387
+        """
388
+        i = 0
389
+        while not self.is_connected() and i < timeout * 10:
390
+            i += 1
391
+            time.sleep(.1)
392
+        if not self.is_connected():
393
+            return False
394
+        else:
395
+            for tx_data in self.__chunks__(data):
396
+                self.__queue__.enqueue(1, self.__tx__, tx_data)
397
+        return True
398
+
399
+
400
+class direct_socket_client(direct_socket_base):
401
+    """
402
+    Class to create a direct client socket. See also parent :class:`helpers.direct_socket_base`.
403
+
404
+    **Example:**
405
+
406
+    .. literalinclude:: helpers/_examples_/direct_socket.py
407
+
408
+    Will result to the following output:
409
+
410
+    .. literalinclude:: helpers/_examples_/direct_socket.log
411
+    """
412
+    IS_CLIENT = True
413
+
414
+    def connect(self, remote_socket):
415
+        """
416
+        Method to create a connection between this client and a :class:`helpers.direct_socket_server` instance.
417
+
418
+        :param remote_socket: The remote socket to connect to.
419
+        :type remote_socket: :class:`helpers.direct_socket_server`
420
+        """
421
+        self.__connect__(remote_socket)
422
+
423
+    def reconnect(self):
424
+        """
425
+        Method to do a reconnect.
426
+
427
+        .. note:: The :const:`remote_socket` of the prefious :func:`connect` call will be used.
428
+        """
429
+        if self.__last_remote_socket__ is not None and self.__remote_socket__ is None:
430
+            self.connect(self.__last_remote_socket__)
431
+            return True
432
+        return False
433
+
434
+
435
+class direct_socket_server(direct_socket_base):
436
+    """
437
+    Class to create a direct server socket. See also parent :class:`helpers.direct_socket_base`.
438
+
439
+    **Example:**
440
+
441
+    .. literalinclude:: helpers/_examples_/direct_socket.py
442
+
443
+    Will result to the following output:
444
+
445
+    .. literalinclude:: helpers/_examples_/direct_socket.log
446
+    """
447
+    IS_CLIENT = False
448
+
449
+    def __init__(self, *args, **kwargs):
450
+        direct_socket_base.__init__(self, *args, **kwargs)
451
+        self.logger.info('%s Waiting for incomming connection', self.__log_prefix__())
99 452
 
100 453
 
101 454
 class ringbuffer(list):
455
+    """
456
+    Class for a list with a limited number of elements.
457
+
458
+    .. note:: On adding Objects, the list will be reduced to the maximum length by deleting entries starting from index 0.
459
+
460
+    **Example:**
461
+
462
+    .. literalinclude:: helpers/_examples_/ringbuffer.py
463
+
464
+    Will result to the following output:
465
+
466
+    .. literalinclude:: helpers/_examples_/ringbuffer.log
467
+    """
102 468
     def __init__(self, *args, **kwargs):
103 469
         self.__max_length__ = kwargs.pop('length')
104 470
         list.__init__(self, *args, **kwargs)
@@ -108,7 +474,12 @@ class ringbuffer(list):
108 474
         while len(self) > self.__max_length__:
109 475
             self.pop(0)
110 476
 
111
-    def append(self, *args, **kwargs):
112
-        rv = list.append(self, *args, **kwargs)
477
+    def append(self, obj):
478
+        rv = list.append(self, obj)
479
+        self.__reduce_list__()
480
+        return rv
481
+
482
+    def extend(self, iterable):
483
+        rv = list.extend(self, iterable)
113 484
         self.__reduce_list__()
114 485
         return rv

+ 4
- 0
_docs_/.buildinfo 查看文件

@@ -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: 92ca02cc31493b7a2ad09dbb3dbe7d60
4
+tags: 645f666f9bcd5a90fca523b33c5a78b7

+ 0
- 0
_docs_/_downloads/fc87e95cc505cb0c7a476506dac46609/unittest.pdf 查看文件


+ 23
- 0
_docs_/_sources/index.rst.txt 查看文件

@@ -0,0 +1,23 @@
1
+.. helpers documentation master file, created by
2
+   sphinx-quickstart on Sat Jan  9 17:41:34 2021.
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 helpers's documentation!
7
+===================================
8
+
9
+.. automodule:: helpers
10
+   :members:
11
+
12
+.. toctree::
13
+   :maxdepth: 2
14
+   :caption: Contents:
15
+
16
+
17
+
18
+Indices and tables
19
+==================
20
+
21
+* :ref:`genindex`
22
+* :ref:`modindex`
23
+* :ref:`search`

+ 676
- 0
_docs_/_static/basic.css 查看文件

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

+ 1
- 0
_docs_/_static/css/badge_only.css 查看文件

@@ -0,0 +1 @@
1
+.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}

二進制
_docs_/_static/css/fonts/Roboto-Slab-Bold.woff 查看文件


二進制
_docs_/_static/css/fonts/Roboto-Slab-Bold.woff2 查看文件


二進制
_docs_/_static/css/fonts/Roboto-Slab-Regular.woff 查看文件


二進制
_docs_/_static/css/fonts/Roboto-Slab-Regular.woff2 查看文件


二進制
_docs_/_static/css/fonts/fontawesome-webfont.eot 查看文件


+ 2671
- 0
_docs_/_static/css/fonts/fontawesome-webfont.svg
文件差異過大導致無法顯示
查看文件


二進制
_docs_/_static/css/fonts/fontawesome-webfont.ttf 查看文件


二進制
_docs_/_static/css/fonts/fontawesome-webfont.woff 查看文件


二進制
_docs_/_static/css/fonts/fontawesome-webfont.woff2 查看文件


二進制
_docs_/_static/css/fonts/lato-bold-italic.woff 查看文件


二進制
_docs_/_static/css/fonts/lato-bold-italic.woff2 查看文件


二進制
_docs_/_static/css/fonts/lato-bold.woff 查看文件


二進制
_docs_/_static/css/fonts/lato-bold.woff2 查看文件


二進制
_docs_/_static/css/fonts/lato-normal-italic.woff 查看文件


二進制
_docs_/_static/css/fonts/lato-normal-italic.woff2 查看文件


二進制
_docs_/_static/css/fonts/lato-normal.woff 查看文件


二進制
_docs_/_static/css/fonts/lato-normal.woff2 查看文件


+ 4
- 0
_docs_/_static/css/theme.css
文件差異過大導致無法顯示
查看文件


+ 315
- 0
_docs_/_static/doctools.js 查看文件

@@ -0,0 +1,315 @@
1
+/*
2
+ * doctools.js
3
+ * ~~~~~~~~~~~
4
+ *
5
+ * Sphinx JavaScript utilities for all documentation.
6
+ *
7
+ * :copyright: Copyright 2007-2019 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 &&
74
+          !jQuery(node.parentNode).hasClass(className) &&
75
+          !jQuery(node.parentNode).hasClass("nohighlight")) {
76
+        var span;
77
+        var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
78
+        if (isInSVG) {
79
+          span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
80
+        } else {
81
+          span = document.createElement("span");
82
+          span.className = className;
83
+        }
84
+        span.appendChild(document.createTextNode(val.substr(pos, text.length)));
85
+        node.parentNode.insertBefore(span, node.parentNode.insertBefore(
86
+          document.createTextNode(val.substr(pos + text.length)),
87
+          node.nextSibling));
88
+        node.nodeValue = val.substr(0, pos);
89
+        if (isInSVG) {
90
+          var bbox = span.getBBox();
91
+          var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
92
+       	  rect.x.baseVal.value = bbox.x;
93
+          rect.y.baseVal.value = bbox.y;
94
+          rect.width.baseVal.value = bbox.width;
95
+          rect.height.baseVal.value = bbox.height;
96
+          rect.setAttribute('class', className);
97
+          var parentOfText = node.parentNode.parentNode;
98
+          addItems.push({
99
+              "parent": node.parentNode,
100
+              "target": rect});
101
+        }
102
+      }
103
+    }
104
+    else if (!jQuery(node).is("button, select, textarea")) {
105
+      jQuery.each(node.childNodes, function() {
106
+        highlight(this, addItems);
107
+      });
108
+    }
109
+  }
110
+  var addItems = [];
111
+  var result = this.each(function() {
112
+    highlight(this, addItems);
113
+  });
114
+  for (var i = 0; i < addItems.length; ++i) {
115
+    jQuery(addItems[i].parent).before(addItems[i].target);
116
+  }
117
+  return result;
118
+};
119
+
120
+/*
121
+ * backward compatibility for jQuery.browser
122
+ * This will be supported until firefox bug is fixed.
123
+ */
124
+if (!jQuery.browser) {
125
+  jQuery.uaMatch = function(ua) {
126
+    ua = ua.toLowerCase();
127
+
128
+    var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
129
+      /(webkit)[ \/]([\w.]+)/.exec(ua) ||
130
+      /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
131
+      /(msie) ([\w.]+)/.exec(ua) ||
132
+      ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
133
+      [];
134
+
135
+    return {
136
+      browser: match[ 1 ] || "",
137
+      version: match[ 2 ] || "0"
138
+    };
139
+  };
140
+  jQuery.browser = {};
141
+  jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
142
+}
143
+
144
+/**
145
+ * Small JavaScript module for the documentation.
146
+ */
147
+var Documentation = {
148
+
149
+  init : function() {
150
+    this.fixFirefoxAnchorBug();
151
+    this.highlightSearchWords();
152
+    this.initIndexTable();
153
+    if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
154
+      this.initOnKeyListeners();
155
+    }
156
+  },
157
+
158
+  /**
159
+   * i18n support
160
+   */
161
+  TRANSLATIONS : {},
162
+  PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
163
+  LOCALE : 'unknown',
164
+
165
+  // gettext and ngettext don't access this so that the functions
166
+  // can safely bound to a different name (_ = Documentation.gettext)
167
+  gettext : function(string) {
168
+    var translated = Documentation.TRANSLATIONS[string];
169
+    if (typeof translated === 'undefined')
170
+      return string;
171
+    return (typeof translated === 'string') ? translated : translated[0];
172
+  },
173
+
174
+  ngettext : function(singular, plural, n) {
175
+    var translated = Documentation.TRANSLATIONS[singular];
176
+    if (typeof translated === 'undefined')
177
+      return (n == 1) ? singular : plural;
178
+    return translated[Documentation.PLURALEXPR(n)];
179
+  },
180
+
181
+  addTranslations : function(catalog) {
182
+    for (var key in catalog.messages)
183
+      this.TRANSLATIONS[key] = catalog.messages[key];
184
+    this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
185
+    this.LOCALE = catalog.locale;
186
+  },
187
+
188
+  /**
189
+   * add context elements like header anchor links
190
+   */
191
+  addContextElements : function() {
192
+    $('div[id] > :header:first').each(function() {
193
+      $('<a class="headerlink">\u00B6</a>').
194
+      attr('href', '#' + this.id).
195
+      attr('title', _('Permalink to this headline')).
196
+      appendTo(this);
197
+    });
198
+    $('dt[id]').each(function() {
199
+      $('<a class="headerlink">\u00B6</a>').
200
+      attr('href', '#' + this.id).
201
+      attr('title', _('Permalink to this definition')).
202
+      appendTo(this);
203
+    });
204
+  },
205
+
206
+  /**
207
+   * workaround a firefox stupidity
208
+   * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
209
+   */
210
+  fixFirefoxAnchorBug : function() {
211
+    if (document.location.hash && $.browser.mozilla)
212
+      window.setTimeout(function() {
213
+        document.location.href += '';
214
+      }, 10);
215
+  },
216
+
217
+  /**
218
+   * highlight the search words provided in the url in the text
219
+   */
220
+  highlightSearchWords : function() {
221
+    var params = $.getQueryParameters();
222
+    var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
223
+    if (terms.length) {
224
+      var body = $('div.body');
225
+      if (!body.length) {
226
+        body = $('body');
227
+      }
228
+      window.setTimeout(function() {
229
+        $.each(terms, function() {
230
+          body.highlightText(this.toLowerCase(), 'highlighted');
231
+        });
232
+      }, 10);
233
+      $('<p class="highlight-link"><a href="javascript:Documentation.' +
234
+        'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
235
+          .appendTo($('#searchbox'));
236
+    }
237
+  },
238
+
239
+  /**
240
+   * init the domain index toggle buttons
241
+   */
242
+  initIndexTable : function() {
243
+    var togglers = $('img.toggler').click(function() {
244
+      var src = $(this).attr('src');
245
+      var idnum = $(this).attr('id').substr(7);
246
+      $('tr.cg-' + idnum).toggle();
247
+      if (src.substr(-9) === 'minus.png')
248
+        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
249
+      else
250
+        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
251
+    }).css('display', '');
252
+    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
253
+        togglers.click();
254
+    }
255
+  },
256
+
257
+  /**
258
+   * helper function to hide the search marks again
259
+   */
260
+  hideSearchWords : function() {
261
+    $('#searchbox .highlight-link').fadeOut(300);
262
+    $('span.highlighted').removeClass('highlighted');
263
+  },
264
+
265
+  /**
266
+   * make the url absolute
267
+   */
268
+  makeURL : function(relativeURL) {
269
+    return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
270
+  },
271
+
272
+  /**
273
+   * get the current relative url
274
+   */
275
+  getCurrentURL : function() {
276
+    var path = document.location.pathname;
277
+    var parts = path.split(/\//);
278
+    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
279
+      if (this === '..')
280
+        parts.pop();
281
+    });
282
+    var url = parts.join('/');
283
+    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
284
+  },
285
+
286
+  initOnKeyListeners: function() {
287
+    $(document).keyup(function(event) {
288
+      var activeElementType = document.activeElement.tagName;
289
+      // don't navigate when in search box or textarea
290
+      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
291
+        switch (event.keyCode) {
292
+          case 37: // left
293
+            var prevHref = $('link[rel="prev"]').prop('href');
294
+            if (prevHref) {
295
+              window.location.href = prevHref;
296
+              return false;
297
+            }
298
+          case 39: // right
299
+            var nextHref = $('link[rel="next"]').prop('href');
300
+            if (nextHref) {
301
+              window.location.href = nextHref;
302
+              return false;
303
+            }
304
+        }
305
+      }
306
+    });
307
+  }
308
+};
309
+
310
+// quick alias for translations
311
+_ = Documentation.gettext;
312
+
313
+$(document).ready(function() {
314
+  Documentation.init();
315
+});

+ 10
- 0
_docs_/_static/documentation_options.js 查看文件

@@ -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
+};

二進制
_docs_/_static/file.png 查看文件


二進制
_docs_/_static/fonts/FontAwesome.otf 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bold.eot 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bold.ttf 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bold.woff 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bold.woff2 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bolditalic.eot 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bolditalic.ttf 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bolditalic.woff 查看文件


二進制
_docs_/_static/fonts/Lato/lato-bolditalic.woff2 查看文件


二進制
_docs_/_static/fonts/Lato/lato-italic.eot 查看文件


二進制
_docs_/_static/fonts/Lato/lato-italic.ttf 查看文件


二進制
_docs_/_static/fonts/Lato/lato-italic.woff 查看文件


二進制
_docs_/_static/fonts/Lato/lato-italic.woff2 查看文件


二進制
_docs_/_static/fonts/Lato/lato-regular.eot 查看文件


二進制
_docs_/_static/fonts/Lato/lato-regular.ttf 查看文件


二進制
_docs_/_static/fonts/Lato/lato-regular.woff 查看文件


二進制
_docs_/_static/fonts/Lato/lato-regular.woff2 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Bold.woff 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Bold.woff2 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Light.woff 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Light.woff2 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Regular.woff 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Regular.woff2 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Thin.woff 查看文件


二進制
_docs_/_static/fonts/Roboto-Slab-Thin.woff2 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff 查看文件


二進制
_docs_/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 查看文件


二進制
_docs_/_static/fonts/fontawesome-webfont.eot 查看文件


+ 2671
- 0
_docs_/_static/fonts/fontawesome-webfont.svg
文件差異過大導致無法顯示
查看文件


二進制
_docs_/_static/fonts/fontawesome-webfont.ttf 查看文件


二進制
_docs_/_static/fonts/fontawesome-webfont.woff 查看文件


二進制
_docs_/_static/fonts/fontawesome-webfont.woff2 查看文件


二進制
_docs_/_static/fonts/lato-bold-italic.woff 查看文件


二進制
_docs_/_static/fonts/lato-bold-italic.woff2 查看文件


二進制
_docs_/_static/fonts/lato-bold.woff 查看文件


二進制
_docs_/_static/fonts/lato-bold.woff2 查看文件


二進制
_docs_/_static/fonts/lato-normal-italic.woff 查看文件


二進制
_docs_/_static/fonts/lato-normal-italic.woff2 查看文件


二進制
_docs_/_static/fonts/lato-normal.woff 查看文件


二進制
_docs_/_static/fonts/lato-normal.woff2 查看文件


+ 10365
- 0
_docs_/_static/jquery.js
文件差異過大導致無法顯示
查看文件


+ 1
- 0
_docs_/_static/js/badge_only.js 查看文件

@@ -0,0 +1 @@
1
+!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}({4:function(e,t,r){}});

+ 4
- 0
_docs_/_static/js/html5shiv-printshiv.min.js 查看文件

@@ -0,0 +1,4 @@
1
+/**
2
+* @preserve HTML5 Shiv 3.7.3-pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
+*/
4
+!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document);

+ 4
- 0
_docs_/_static/js/html5shiv.min.js 查看文件

@@ -0,0 +1,4 @@
1
+/**
2
+* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
3
+*/
4
+!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);

+ 4
- 0
_docs_/_static/js/modernizr.min.js
文件差異過大導致無法顯示
查看文件


+ 1
- 0
_docs_/_static/js/theme.js 查看文件

@@ -0,0 +1 @@
1
+!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("<div class='wy-table-responsive'></div>"),n("table.docutils.footnote").wrap("<div class='wy-table-responsive footnote'></div>"),n("table.docutils.citation").wrap("<div class='wy-table-responsive citation'></div>"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n('<span class="toctree-expand"></span>'),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}t.length>0&&($(".wy-menu-vertical .current").removeClass("current"),t.addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l1").parent().addClass("current"),t.closest("li.toctree-l1").addClass("current"),t.closest("li.toctree-l2").addClass("current"),t.closest("li.toctree-l3").addClass("current"),t.closest("li.toctree-l4").addClass("current"),t.closest("li.toctree-l5").addClass("current"),t[0].scrollIntoView())}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var i=(new Date).getTime(),o=Math.max(0,16-(i-n)),r=window.setTimeout((function(){e(i+o)}),o);return n=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()}).call(window)},function(n,e){n.exports=jQuery},function(n,e,t){}]);

+ 297
- 0
_docs_/_static/language_data.js 查看文件

@@ -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
+

二進制
_docs_/_static/minus.png 查看文件


二進制
_docs_/_static/plus.png 查看文件


+ 69
- 0
_docs_/_static/pygments.css 查看文件

@@ -0,0 +1,69 @@
1
+.highlight .hll { background-color: #ffffcc }
2
+.highlight  { background: #f8f8f8; }
3
+.highlight .c { color: #408080; font-style: italic } /* Comment */
4
+.highlight .err { border: 1px solid #FF0000 } /* Error */
5
+.highlight .k { color: #008000; font-weight: bold } /* Keyword */
6
+.highlight .o { color: #666666 } /* Operator */
7
+.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */
8
+.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */
9
+.highlight .cp { color: #BC7A00 } /* Comment.Preproc */
10
+.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */
11
+.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */
12
+.highlight .cs { color: #408080; font-style: italic } /* 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: #888888 } /* Generic.Output */
19
+.highlight .gp { color: #000080; 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: #008000; font-weight: bold } /* Keyword.Constant */
24
+.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
25
+.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
26
+.highlight .kp { color: #008000 } /* Keyword.Pseudo */
27
+.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
28
+.highlight .kt { color: #B00040 } /* Keyword.Type */
29
+.highlight .m { color: #666666 } /* Literal.Number */
30
+.highlight .s { color: #BA2121 } /* Literal.String */
31
+.highlight .na { color: #7D9029 } /* Name.Attribute */
32
+.highlight .nb { color: #008000 } /* Name.Builtin */
33
+.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
34
+.highlight .no { color: #880000 } /* Name.Constant */
35
+.highlight .nd { color: #AA22FF } /* Name.Decorator */
36
+.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
37
+.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
38
+.highlight .nf { color: #0000FF } /* Name.Function */
39
+.highlight .nl { color: #A0A000 } /* Name.Label */
40
+.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
41
+.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
42
+.highlight .nv { color: #19177C } /* Name.Variable */
43
+.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
44
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
45
+.highlight .mb { color: #666666 } /* Literal.Number.Bin */
46
+.highlight .mf { color: #666666 } /* Literal.Number.Float */
47
+.highlight .mh { color: #666666 } /* Literal.Number.Hex */
48
+.highlight .mi { color: #666666 } /* Literal.Number.Integer */
49
+.highlight .mo { color: #666666 } /* Literal.Number.Oct */
50
+.highlight .sa { color: #BA2121 } /* Literal.String.Affix */
51
+.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
52
+.highlight .sc { color: #BA2121 } /* Literal.String.Char */
53
+.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
54
+.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
55
+.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
56
+.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
57
+.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
58
+.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
59
+.highlight .sx { color: #008000 } /* Literal.String.Other */
60
+.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
61
+.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
62
+.highlight .ss { color: #19177C } /* Literal.String.Symbol */
63
+.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
64
+.highlight .fm { color: #0000FF } /* Name.Function.Magic */
65
+.highlight .vc { color: #19177C } /* Name.Variable.Class */
66
+.highlight .vg { color: #19177C } /* Name.Variable.Global */
67
+.highlight .vi { color: #19177C } /* Name.Variable.Instance */
68
+.highlight .vm { color: #19177C } /* Name.Variable.Magic */
69
+.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */

+ 481
- 0
_docs_/_static/searchtools.js 查看文件

@@ -0,0 +1,481 @@
1
+/*
2
+ * searchtools.js
3
+ * ~~~~~~~~~~~~~~~~
4
+ *
5
+ * Sphinx JavaScript utilities for the full-text search.
6
+ *
7
+ * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
8
+ * :license: BSD, see LICENSE for details.
9
+ *
10
+ */
11
+
12
+if (!Scorer) {
13
+  /**
14
+   * Simple result scoring code.
15
+   */
16
+  var Scorer = {
17
+    // Implement the following function to further tweak the score for each result
18
+    // The function takes a result array [filename, title, anchor, descr, score]
19
+    // and returns the new score.
20
+    /*
21
+    score: function(result) {
22
+      return result[4];
23
+    },
24
+    */
25
+
26
+    // query matches the full name of an object
27
+    objNameMatch: 11,
28
+    // or matches in the last dotted part of the object name
29
+    objPartialMatch: 6,
30
+    // Additive scores depending on the priority of the object
31
+    objPrio: {0:  15,   // used to be importantResults
32
+              1:  5,   // used to be objectResults
33
+              2: -5},  // used to be unimportantResults
34
+    //  Used when the priority is not in the mapping.
35
+    objPrioDefault: 0,
36
+
37
+    // query found in title
38
+    title: 15,
39
+    // query found in terms
40
+    term: 5
41
+  };
42
+}
43
+
44
+if (!splitQuery) {
45
+  function splitQuery(query) {
46
+    return query.split(/\s+/);
47
+  }
48
+}
49
+
50
+/**
51
+ * Search Module
52
+ */
53
+var Search = {
54
+
55
+  _index : null,
56
+  _queued_query : null,
57
+  _pulse_status : -1,
58
+
59
+  init : function() {
60
+      var params = $.getQueryParameters();
61
+      if (params.q) {
62
+          var query = params.q[0];
63
+          $('input[name="q"]')[0].value = query;
64
+          this.performSearch(query);
65
+      }
66
+  },
67
+
68
+  loadIndex : function(url) {
69
+    $.ajax({type: "GET", url: url, data: null,
70
+            dataType: "script", cache: true,
71
+            complete: function(jqxhr, textstatus) {
72
+              if (textstatus != "success") {
73
+                document.getElementById("searchindexloader").src = url;
74
+              }
75
+            }});
76
+  },
77
+
78
+  setIndex : function(index) {
79
+    var q;
80
+    this._index = index;
81
+    if ((q = this._queued_query) !== null) {
82
+      this._queued_query = null;
83
+      Search.query(q);
84
+    }
85
+  },
86
+
87
+  hasIndex : function() {
88
+      return this._index !== null;
89
+  },
90
+
91
+  deferQuery : function(query) {
92
+      this._queued_query = query;
93
+  },
94
+
95
+  stopPulse : function() {
96
+      this._pulse_status = 0;
97
+  },
98
+
99
+  startPulse : function() {
100
+    if (this._pulse_status >= 0)
101
+        return;
102
+    function pulse() {
103
+      var i;
104
+      Search._pulse_status = (Search._pulse_status + 1) % 4;
105
+      var dotString = '';
106
+      for (i = 0; i < Search._pulse_status; i++)
107
+        dotString += '.';
108
+      Search.dots.text(dotString);
109
+      if (Search._pulse_status > -1)
110
+        window.setTimeout(pulse, 500);
111
+    }
112
+    pulse();
113
+  },
114
+
115
+  /**
116
+   * perform a search for something (or wait until index is loaded)
117
+   */
118
+  performSearch : function(query) {
119
+    // create the required interface elements
120
+    this.out = $('#search-results');
121
+    this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
122
+    this.dots = $('<span></span>').appendTo(this.title);
123
+    this.status = $('<p style="display: none"></p>').appendTo(this.out);
124
+    this.output = $('<ul class="search"/>').appendTo(this.out);
125
+
126
+    $('#search-progress').text(_('Preparing search...'));
127
+    this.startPulse();
128
+
129
+    // index already loaded, the browser was quick!
130
+    if (this.hasIndex())
131
+      this.query(query);
132
+    else
133
+      this.deferQuery(query);
134
+  },
135
+
136
+  /**
137
+   * execute search (requires search index to be loaded)
138
+   */
139
+  query : function(query) {
140
+    var i;
141
+
142
+    // stem the searchterms and add them to the correct list
143
+    var stemmer = new Stemmer();
144
+    var searchterms = [];
145
+    var excluded = [];
146
+    var hlterms = [];
147
+    var tmp = splitQuery(query);
148
+    var objectterms = [];
149
+    for (i = 0; i < tmp.length; i++) {
150
+      if (tmp[i] !== "") {
151
+          objectterms.push(tmp[i].toLowerCase());
152
+      }
153
+
154
+      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
155
+          tmp[i] === "") {
156
+        // skip this "word"
157
+        continue;
158
+      }
159
+      // stem the word
160
+      var word = stemmer.stemWord(tmp[i].toLowerCase());
161
+      // prevent stemmer from cutting word smaller than two chars
162
+      if(word.length < 3 && tmp[i].length >= 3) {
163
+        word = tmp[i];
164
+      }
165
+      var toAppend;
166
+      // select the correct list
167
+      if (word[0] == '-') {
168
+        toAppend = excluded;
169
+        word = word.substr(1);
170
+      }
171
+      else {
172
+        toAppend = searchterms;
173
+        hlterms.push(tmp[i].toLowerCase());
174
+      }
175
+      // only add if not already in the list
176
+      if (!$u.contains(toAppend, word))
177
+        toAppend.push(word);
178
+    }
179
+    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
180
+
181
+    // console.debug('SEARCH: searching for:');
182
+    // console.info('required: ', searchterms);
183
+    // console.info('excluded: ', excluded);
184
+
185
+    // prepare search
186
+    var terms = this._index.terms;
187
+    var titleterms = this._index.titleterms;
188
+
189
+    // array of [filename, title, anchor, descr, score]
190
+    var results = [];
191
+    $('#search-progress').empty();
192
+
193
+    // lookup as object
194
+    for (i = 0; i < objectterms.length; i++) {
195
+      var others = [].concat(objectterms.slice(0, i),
196
+                             objectterms.slice(i+1, objectterms.length));
197
+      results = results.concat(this.performObjectSearch(objectterms[i], others));
198
+    }
199
+
200
+    // lookup as search terms in fulltext
201
+    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
202
+
203
+    // let the scorer override scores with a custom scoring function
204
+    if (Scorer.score) {
205
+      for (i = 0; i < results.length; i++)
206
+        results[i][4] = Scorer.score(results[i]);
207
+    }
208
+
209
+    // now sort the results by score (in opposite order of appearance, since the
210
+    // display function below uses pop() to retrieve items) and then
211
+    // alphabetically
212
+    results.sort(function(a, b) {
213
+      var left = a[4];
214
+      var right = b[4];
215
+      if (left > right) {
216
+        return 1;
217
+      } else if (left < right) {
218
+        return -1;
219
+      } else {
220
+        // same score: sort alphabetically
221
+        left = a[1].toLowerCase();
222
+        right = b[1].toLowerCase();
223
+        return (left > right) ? -1 : ((left < right) ? 1 : 0);
224
+      }
225
+    });
226
+
227
+    // for debugging
228
+    //Search.lastresults = results.slice();  // a copy
229
+    //console.info('search results:', Search.lastresults);
230
+
231
+    // print the results
232
+    var resultCount = results.length;
233
+    function displayNextItem() {
234
+      // results left, load the summary and display it
235
+      if (results.length) {
236
+        var item = results.pop();
237
+        var listItem = $('<li style="display:none"></li>');
238
+        if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
239
+          // dirhtml builder
240
+          var dirname = item[0] + '/';
241
+          if (dirname.match(/\/index\/$/)) {
242
+            dirname = dirname.substring(0, dirname.length-6);
243
+          } else if (dirname == 'index/') {
244
+            dirname = '';
245
+          }
246
+          listItem.append($('<a/>').attr('href',
247
+            DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
248
+            highlightstring + item[2]).html(item[1]));
249
+        } else {
250
+          // normal html builders
251
+          listItem.append($('<a/>').attr('href',
252
+            item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
253
+            highlightstring + item[2]).html(item[1]));
254
+        }
255
+        if (item[3]) {
256
+          listItem.append($('<span> (' + item[3] + ')</span>'));
257
+          Search.output.append(listItem);
258
+          listItem.slideDown(5, function() {
259
+            displayNextItem();
260
+          });
261
+        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
262
+          var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
263
+          if (suffix === undefined) {
264
+            suffix = '.txt';
265
+          }
266
+          $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
267
+                  dataType: "text",
268
+                  complete: function(jqxhr, textstatus) {
269
+                    var data = jqxhr.responseText;
270
+                    if (data !== '' && data !== undefined) {
271
+                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
272
+                    }
273
+                    Search.output.append(listItem);
274
+                    listItem.slideDown(5, function() {
275
+                      displayNextItem();
276
+                    });
277
+                  }});
278
+        } else {
279
+          // no source available, just display title
280
+          Search.output.append(listItem);
281
+          listItem.slideDown(5, function() {
282
+            displayNextItem();
283
+          });
284
+        }
285
+      }
286
+      // search finished, update title and status message
287
+      else {
288
+        Search.stopPulse();
289
+        Search.title.text(_('Search Results'));
290
+        if (!resultCount)
291
+          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.'));
292
+        else
293
+            Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
294
+        Search.status.fadeIn(500);
295
+      }
296
+    }
297
+    displayNextItem();
298
+  },
299
+
300
+  /**
301
+   * search for object names
302
+   */
303
+  performObjectSearch : function(object, otherterms) {
304
+    var filenames = this._index.filenames;
305
+    var docnames = this._index.docnames;
306
+    var objects = this._index.objects;
307
+    var objnames = this._index.objnames;
308
+    var titles = this._index.titles;
309
+
310
+    var i;
311
+    var results = [];
312
+
313
+    for (var prefix in objects) {
314
+      for (var name in objects[prefix]) {
315
+        var fullname = (prefix ? prefix + '.' : '') + name;
316
+        if (fullname.toLowerCase().indexOf(object) > -1) {
317
+          var score = 0;
318
+          var parts = fullname.split('.');
319
+          // check for different match types: exact matches of full name or
320
+          // "last name" (i.e. last dotted part)
321
+          if (fullname == object || parts[parts.length - 1] == object) {
322
+            score += Scorer.objNameMatch;
323
+          // matches in last name
324
+          } else if (parts[parts.length - 1].indexOf(object) > -1) {
325
+            score += Scorer.objPartialMatch;
326
+          }
327
+          var match = objects[prefix][name];
328
+          var objname = objnames[match[1]][2];
329
+          var title = titles[match[0]];
330
+          // If more than one term searched for, we require other words to be
331
+          // found in the name/title/description
332
+          if (otherterms.length > 0) {
333
+            var haystack = (prefix + ' ' + name + ' ' +
334
+                            objname + ' ' + title).toLowerCase();
335
+            var allfound = true;
336
+            for (i = 0; i < otherterms.length; i++) {
337
+              if (haystack.indexOf(otherterms[i]) == -1) {
338
+                allfound = false;
339
+                break;
340
+              }
341
+            }
342
+            if (!allfound) {
343
+              continue;
344
+            }
345
+          }
346
+          var descr = objname + _(', in ') + title;
347
+
348
+          var anchor = match[3];
349
+          if (anchor === '')
350
+            anchor = fullname;
351
+          else if (anchor == '-')
352
+            anchor = objnames[match[1]][1] + '-' + fullname;
353
+          // add custom score for some objects according to scorer
354
+          if (Scorer.objPrio.hasOwnProperty(match[2])) {
355
+            score += Scorer.objPrio[match[2]];
356
+          } else {
357
+            score += Scorer.objPrioDefault;
358
+          }
359
+          results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
360
+        }
361
+      }
362
+    }
363
+
364
+    return results;
365
+  },
366
+
367
+  /**
368
+   * search for full-text terms in the index
369
+   */
370
+  performTermsSearch : function(searchterms, excluded, terms, titleterms) {
371
+    var docnames = this._index.docnames;
372
+    var filenames = this._index.filenames;
373
+    var titles = this._index.titles;
374
+
375
+    var i, j, file;
376
+    var fileMap = {};
377
+    var scoreMap = {};
378
+    var results = [];
379
+
380
+    // perform the search on the required terms
381
+    for (i = 0; i < searchterms.length; i++) {
382
+      var word = searchterms[i];
383
+      var files = [];
384
+      var _o = [
385
+        {files: terms[word], score: Scorer.term},
386
+        {files: titleterms[word], score: Scorer.title}
387
+      ];
388
+
389
+      // no match but word was a required one
390
+      if ($u.every(_o, function(o){return o.files === undefined;})) {
391
+        break;
392
+      }
393
+      // found search word in contents
394
+      $u.each(_o, function(o) {
395
+        var _files = o.files;
396
+        if (_files === undefined)
397
+          return
398
+
399
+        if (_files.length === undefined)
400
+          _files = [_files];
401
+        files = files.concat(_files);
402
+
403
+        // set score for the word in each file to Scorer.term
404
+        for (j = 0; j < _files.length; j++) {
405
+          file = _files[j];
406
+          if (!(file in scoreMap))
407
+            scoreMap[file] = {}
408
+          scoreMap[file][word] = o.score;
409
+        }
410
+      });
411
+
412
+      // create the mapping
413
+      for (j = 0; j < files.length; j++) {
414
+        file = files[j];
415
+        if (file in fileMap)
416
+          fileMap[file].push(word);
417
+        else
418
+          fileMap[file] = [word];
419
+      }
420
+    }
421
+
422
+    // now check if the files don't contain excluded terms
423
+    for (file in fileMap) {
424
+      var valid = true;
425
+
426
+      // check if all requirements are matched
427
+      if (fileMap[file].length != searchterms.length)
428
+          continue;
429
+
430
+      // ensure that none of the excluded terms is in the search result
431
+      for (i = 0; i < excluded.length; i++) {
432
+        if (terms[excluded[i]] == file ||
433
+            titleterms[excluded[i]] == file ||
434
+            $u.contains(terms[excluded[i]] || [], file) ||
435
+            $u.contains(titleterms[excluded[i]] || [], file)) {
436
+          valid = false;
437
+          break;
438
+        }
439
+      }
440
+
441
+      // if we have still a valid result we can add it to the result list
442
+      if (valid) {
443
+        // select one (max) score for the file.
444
+        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
445
+        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
446
+        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
447
+      }
448
+    }
449
+    return results;
450
+  },
451
+
452
+  /**
453
+   * helper function to return a node containing the
454
+   * search summary for a given text. keywords is a list
455
+   * of stemmed words, hlwords is the list of normal, unstemmed
456
+   * words. the first one is used to find the occurrence, the
457
+   * latter for highlighting it.
458
+   */
459
+  makeSearchSummary : function(text, keywords, hlwords) {
460
+    var textLower = text.toLowerCase();
461
+    var start = 0;
462
+    $.each(keywords, function() {
463
+      var i = textLower.indexOf(this.toLowerCase());
464
+      if (i > -1)
465
+        start = i;
466
+    });
467
+    start = Math.max(start - 120, 0);
468
+    var excerpt = ((start > 0) ? '...' : '') +
469
+      $.trim(text.substr(start, 240)) +
470
+      ((start + 240 - text.length) ? '...' : '');
471
+    var rv = $('<div class="context"></div>').text(excerpt);
472
+    $.each(hlwords, function() {
473
+      rv = rv.highlightText(this, 'highlighted');
474
+    });
475
+    return rv;
476
+  }
477
+};
478
+
479
+$(document).ready(function() {
480
+  Search.init();
481
+});

+ 1692
- 0
_docs_/_static/underscore.js
文件差異過大導致無法顯示
查看文件


+ 340
- 0
_docs_/genindex.html 查看文件

@@ -0,0 +1,340 @@
1
+
2
+
3
+
4
+<!DOCTYPE html>
5
+<html class="writer-html4" lang="en" >
6
+<head>
7
+  <meta charset="utf-8">
8
+  
9
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
+  
11
+  <title>Index &mdash; helpers  documentation</title>
12
+  
13
+
14
+  
15
+  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
16
+  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
17
+
18
+  
19
+  
20
+  
21
+  
22
+
23
+  
24
+  <!--[if lt IE 9]>
25
+    <script src="_static/js/html5shiv.min.js"></script>
26
+  <![endif]-->
27
+  
28
+    
29
+      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
30
+        <script type="text/javascript" src="_static/jquery.js"></script>
31
+        <script type="text/javascript" src="_static/underscore.js"></script>
32
+        <script type="text/javascript" src="_static/doctools.js"></script>
33
+        <script type="text/javascript" src="_static/language_data.js"></script>
34
+    
35
+    <script type="text/javascript" src="_static/js/theme.js"></script>
36
+
37
+    
38
+    <link rel="index" title="Index" href="#" />
39
+    <link rel="search" title="Search" href="search.html" /> 
40
+</head>
41
+
42
+<body class="wy-body-for-nav">
43
+
44
+   
45
+  <div class="wy-grid-for-nav">
46
+    
47
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48
+      <div class="wy-side-scroll">
49
+        <div class="wy-side-nav-search" >
50
+          
51
+
52
+          
53
+            <a href="index.html" class="icon icon-home" alt="Documentation Home"> helpers
54
+          
55
+
56
+          
57
+          </a>
58
+
59
+          
60
+            
61
+            
62
+          
63
+
64
+          
65
+<div role="search">
66
+  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
67
+    <input type="text" name="q" placeholder="Search docs" />
68
+    <input type="hidden" name="check_keywords" value="yes" />
69
+    <input type="hidden" name="area" value="default" />
70
+  </form>
71
+</div>
72
+
73
+          
74
+        </div>
75
+
76
+        
77
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
78
+          
79
+            
80
+            
81
+              
82
+            
83
+            
84
+              <!-- Local TOC -->
85
+              <div class="local-toc"></div>
86
+            
87
+          
88
+        </div>
89
+        
90
+      </div>
91
+    </nav>
92
+
93
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
+
95
+      
96
+      <nav class="wy-nav-top" aria-label="top navigation">
97
+        
98
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
99
+          <a href="index.html">helpers</a>
100
+        
101
+      </nav>
102
+
103
+
104
+      <div class="wy-nav-content">
105
+        
106
+        <div class="rst-content">
107
+        
108
+          
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+<div role="navigation" aria-label="breadcrumbs navigation">
125
+
126
+  <ul class="wy-breadcrumbs">
127
+    
128
+      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
129
+        
130
+      <li>Index</li>
131
+    
132
+    
133
+      <li class="wy-breadcrumbs-aside">
134
+        
135
+            
136
+        
137
+      </li>
138
+    
139
+  </ul>
140
+
141
+  
142
+  <hr/>
143
+</div>
144
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
145
+           <div itemprop="articleBody">
146
+            
147
+
148
+<h1 id="index">Index</h1>
149
+
150
+<div class="genindex-jumpbox">
151
+ <a href="#A"><strong>A</strong></a>
152
+ | <a href="#C"><strong>C</strong></a>
153
+ | <a href="#D"><strong>D</strong></a>
154
+ | <a href="#E"><strong>E</strong></a>
155
+ | <a href="#H"><strong>H</strong></a>
156
+ | <a href="#I"><strong>I</strong></a>
157
+ | <a href="#M"><strong>M</strong></a>
158
+ | <a href="#P"><strong>P</strong></a>
159
+ | <a href="#Q"><strong>Q</strong></a>
160
+ | <a href="#R"><strong>R</strong></a>
161
+ | <a href="#S"><strong>S</strong></a>
162
+ 
163
+</div>
164
+<h2 id="A">A</h2>
165
+<table style="width: 100%" class="indextable genindextable"><tr>
166
+  <td style="width: 33%; vertical-align: top;"><ul>
167
+      <li><a href="index.html#helpers.ringbuffer.append">append() (helpers.ringbuffer method)</a>
168
+</li>
169
+  </ul></td>
170
+</tr></table>
171
+
172
+<h2 id="C">C</h2>
173
+<table style="width: 100%" class="indextable genindextable"><tr>
174
+  <td style="width: 33%; vertical-align: top;"><ul>
175
+      <li><a href="index.html#helpers.direct_socket_client.connect">connect() (helpers.direct_socket_client method)</a>
176
+</li>
177
+  </ul></td>
178
+  <td style="width: 33%; vertical-align: top;"><ul>
179
+      <li><a href="index.html#helpers.continues_statistic">continues_statistic (class in helpers)</a>
180
+</li>
181
+      <li><a href="index.html#helpers.continues_statistic_multivalue">continues_statistic_multivalue (class in helpers)</a>
182
+</li>
183
+  </ul></td>
184
+</tr></table>
185
+
186
+<h2 id="D">D</h2>
187
+<table style="width: 100%" class="indextable genindextable"><tr>
188
+  <td style="width: 33%; vertical-align: top;"><ul>
189
+      <li><a href="index.html#helpers.direct_socket_base">direct_socket_base (class in helpers)</a>
190
+</li>
191
+      <li><a href="index.html#helpers.direct_socket_client">direct_socket_client (class in helpers)</a>
192
+</li>
193
+  </ul></td>
194
+  <td style="width: 33%; vertical-align: top;"><ul>
195
+      <li><a href="index.html#helpers.direct_socket_server">direct_socket_server (class in helpers)</a>
196
+</li>
197
+      <li><a href="index.html#helpers.direct_socket_base.disconnect">disconnect() (helpers.direct_socket_base method)</a>
198
+</li>
199
+  </ul></td>
200
+</tr></table>
201
+
202
+<h2 id="E">E</h2>
203
+<table style="width: 100%" class="indextable genindextable"><tr>
204
+  <td style="width: 33%; vertical-align: top;"><ul>
205
+      <li><a href="index.html#helpers.ringbuffer.extend">extend() (helpers.ringbuffer method)</a>
206
+</li>
207
+  </ul></td>
208
+</tr></table>
209
+
210
+<h2 id="H">H</h2>
211
+<table style="width: 100%" class="indextable genindextable"><tr>
212
+  <td style="width: 33%; vertical-align: top;"><ul>
213
+      <li><a href="index.html#module-helpers">helpers (module)</a>
214
+</li>
215
+  </ul></td>
216
+</tr></table>
217
+
218
+<h2 id="I">I</h2>
219
+<table style="width: 100%" class="indextable genindextable"><tr>
220
+  <td style="width: 33%; vertical-align: top;"><ul>
221
+      <li><a href="index.html#helpers.direct_socket_base.init_channel_name">init_channel_name() (helpers.direct_socket_base method)</a>
222
+</li>
223
+  </ul></td>
224
+  <td style="width: 33%; vertical-align: top;"><ul>
225
+      <li><a href="index.html#helpers.direct_socket_base.is_connected">is_connected() (helpers.direct_socket_base method)</a>
226
+</li>
227
+  </ul></td>
228
+</tr></table>
229
+
230
+<h2 id="M">M</h2>
231
+<table style="width: 100%" class="indextable genindextable"><tr>
232
+  <td style="width: 33%; vertical-align: top;"><ul>
233
+      <li><a href="index.html#helpers.continues_statistic.max">max (helpers.continues_statistic attribute)</a>
234
+</li>
235
+  </ul></td>
236
+  <td style="width: 33%; vertical-align: top;"><ul>
237
+      <li><a href="index.html#helpers.continues_statistic.mean">mean (helpers.continues_statistic attribute)</a>
238
+</li>
239
+      <li><a href="index.html#helpers.continues_statistic.min">min (helpers.continues_statistic attribute)</a>
240
+</li>
241
+  </ul></td>
242
+</tr></table>
243
+
244
+<h2 id="P">P</h2>
245
+<table style="width: 100%" class="indextable genindextable"><tr>
246
+  <td style="width: 33%; vertical-align: top;"><ul>
247
+      <li><a href="index.html#helpers.continues_statistic.pop">pop() (helpers.continues_statistic method)</a>
248
+
249
+      <ul>
250
+        <li><a href="index.html#helpers.continues_statistic_multivalue.pop">(helpers.continues_statistic_multivalue method)</a>
251
+</li>
252
+      </ul></li>
253
+  </ul></td>
254
+</tr></table>
255
+
256
+<h2 id="Q">Q</h2>
257
+<table style="width: 100%" class="indextable genindextable"><tr>
258
+  <td style="width: 33%; vertical-align: top;"><ul>
259
+      <li><a href="index.html#helpers.continues_statistic.quantifier">quantifier (helpers.continues_statistic attribute)</a>
260
+</li>
261
+  </ul></td>
262
+</tr></table>
263
+
264
+<h2 id="R">R</h2>
265
+<table style="width: 100%" class="indextable genindextable"><tr>
266
+  <td style="width: 33%; vertical-align: top;"><ul>
267
+      <li><a href="index.html#helpers.direct_socket_base.receive">receive() (helpers.direct_socket_base method)</a>
268
+</li>
269
+      <li><a href="index.html#helpers.direct_socket_client.reconnect">reconnect() (helpers.direct_socket_client method)</a>
270
+</li>
271
+      <li><a href="index.html#helpers.direct_socket_base.register_callback">register_callback() (helpers.direct_socket_base method)</a>
272
+</li>
273
+  </ul></td>
274
+  <td style="width: 33%; vertical-align: top;"><ul>
275
+      <li><a href="index.html#helpers.direct_socket_base.register_connect_callback">register_connect_callback() (helpers.direct_socket_base method)</a>
276
+</li>
277
+      <li><a href="index.html#helpers.direct_socket_base.register_disconnect_callback">register_disconnect_callback() (helpers.direct_socket_base method)</a>
278
+</li>
279
+      <li><a href="index.html#helpers.ringbuffer">ringbuffer (class in helpers)</a>
280
+</li>
281
+  </ul></td>
282
+</tr></table>
283
+
284
+<h2 id="S">S</h2>
285
+<table style="width: 100%" class="indextable genindextable"><tr>
286
+  <td style="width: 33%; vertical-align: top;"><ul>
287
+      <li><a href="index.html#helpers.direct_socket_base.send">send() (helpers.direct_socket_base method)</a>
288
+</li>
289
+  </ul></td>
290
+</tr></table>
291
+
292
+
293
+
294
+           </div>
295
+           
296
+          </div>
297
+          <footer>
298
+  
299
+
300
+  <hr/>
301
+
302
+  <div role="contentinfo">
303
+    <p>
304
+        
305
+        &copy; Copyright 2021, Dirk Alders
306
+
307
+    </p>
308
+  </div>
309
+    
310
+    
311
+    
312
+    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
313
+    
314
+    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
315
+    
316
+    provided by <a href="https://readthedocs.org">Read the Docs</a>. 
317
+
318
+</footer>
319
+
320
+        </div>
321
+      </div>
322
+
323
+    </section>
324
+
325
+  </div>
326
+  
327
+
328
+  <script type="text/javascript">
329
+      jQuery(function () {
330
+          SphinxRtdTheme.Navigation.enable(true);
331
+      });
332
+  </script>
333
+
334
+  
335
+  
336
+    
337
+   
338
+
339
+</body>
340
+</html>

+ 724
- 0
_docs_/index.html 查看文件

@@ -0,0 +1,724 @@
1
+
2
+
3
+<!DOCTYPE html>
4
+<html class="writer-html4" lang="en" >
5
+<head>
6
+  <meta charset="utf-8">
7
+  
8
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+  
10
+  <title>Welcome to helpers’s documentation! &mdash; helpers  documentation</title>
11
+  
12
+
13
+  
14
+  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
15
+  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16
+
17
+  
18
+  
19
+  
20
+  
21
+
22
+  
23
+  <!--[if lt IE 9]>
24
+    <script src="_static/js/html5shiv.min.js"></script>
25
+  <![endif]-->
26
+  
27
+    
28
+      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
29
+        <script type="text/javascript" src="_static/jquery.js"></script>
30
+        <script type="text/javascript" src="_static/underscore.js"></script>
31
+        <script type="text/javascript" src="_static/doctools.js"></script>
32
+        <script type="text/javascript" src="_static/language_data.js"></script>
33
+    
34
+    <script type="text/javascript" src="_static/js/theme.js"></script>
35
+
36
+    
37
+    <link rel="index" title="Index" href="genindex.html" />
38
+    <link rel="search" title="Search" href="search.html" /> 
39
+</head>
40
+
41
+<body class="wy-body-for-nav">
42
+
43
+   
44
+  <div class="wy-grid-for-nav">
45
+    
46
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
47
+      <div class="wy-side-scroll">
48
+        <div class="wy-side-nav-search" >
49
+          
50
+
51
+          
52
+            <a href="#" class="icon icon-home" alt="Documentation Home"> helpers
53
+          
54
+
55
+          
56
+          </a>
57
+
58
+          
59
+            
60
+            
61
+          
62
+
63
+          
64
+<div role="search">
65
+  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
66
+    <input type="text" name="q" placeholder="Search docs" />
67
+    <input type="hidden" name="check_keywords" value="yes" />
68
+    <input type="hidden" name="area" value="default" />
69
+  </form>
70
+</div>
71
+
72
+          
73
+        </div>
74
+
75
+        
76
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
77
+          
78
+            
79
+            
80
+              
81
+            
82
+            
83
+              <!-- Local TOC -->
84
+              <div class="local-toc"><ul>
85
+<li><a class="reference internal" href="#">Welcome to helpers’s documentation!</a><ul>
86
+<li><a class="reference internal" href="#helpers-helpers">helpers (Helpers)</a></li>
87
+</ul>
88
+</li>
89
+<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
90
+</ul>
91
+</div>
92
+            
93
+          
94
+        </div>
95
+        
96
+      </div>
97
+    </nav>
98
+
99
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
100
+
101
+      
102
+      <nav class="wy-nav-top" aria-label="top navigation">
103
+        
104
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
105
+          <a href="#">helpers</a>
106
+        
107
+      </nav>
108
+
109
+
110
+      <div class="wy-nav-content">
111
+        
112
+        <div class="rst-content">
113
+        
114
+          
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+<div role="navigation" aria-label="breadcrumbs navigation">
131
+
132
+  <ul class="wy-breadcrumbs">
133
+    
134
+      <li><a href="#" class="icon icon-home"></a> &raquo;</li>
135
+        
136
+      <li>Welcome to helpers’s documentation!</li>
137
+    
138
+    
139
+      <li class="wy-breadcrumbs-aside">
140
+        
141
+            
142
+            <a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
143
+          
144
+        
145
+      </li>
146
+    
147
+  </ul>
148
+
149
+  
150
+  <hr/>
151
+</div>
152
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
153
+           <div itemprop="articleBody">
154
+            
155
+  <div class="section" id="module-helpers">
156
+<span id="welcome-to-helpers-s-documentation"></span><h1>Welcome to helpers’s documentation!<a class="headerlink" href="#module-helpers" title="Permalink to this headline">¶</a></h1>
157
+<div class="section" id="helpers-helpers">
158
+<h2>helpers (Helpers)<a class="headerlink" href="#helpers-helpers" title="Permalink to this headline">¶</a></h2>
159
+<p><strong>Author:</strong></p>
160
+<ul class="simple">
161
+<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>
162
+</ul>
163
+<p><strong>Description:</strong></p>
164
+<blockquote>
165
+<div>This module supports functions and classes which don’t have an own Module (yet).</div></blockquote>
166
+<p><strong>Submodules:</strong></p>
167
+<ul class="simple">
168
+<li><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a></li>
169
+<li><a class="reference internal" href="#helpers.continues_statistic_multivalue" title="helpers.continues_statistic_multivalue"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic_multivalue</span></code></a></li>
170
+<li><a class="reference internal" href="#helpers.direct_socket_client" title="helpers.direct_socket_client"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_client</span></code></a></li>
171
+<li><a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a></li>
172
+<li><a class="reference internal" href="#helpers.ringbuffer" title="helpers.ringbuffer"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.ringbuffer</span></code></a></li>
173
+</ul>
174
+<p><strong>Unittest:</strong></p>
175
+<blockquote>
176
+<div>See also the <a class="reference download internal" download="" href="_downloads/fc87e95cc505cb0c7a476506dac46609/unittest.pdf"><code class="xref download docutils literal notranslate"><span class="pre">unittest</span></code></a> documentation.</div></blockquote>
177
+<p><strong>Module Documentation:</strong></p>
178
+<dl class="class">
179
+<dt id="helpers.continues_statistic">
180
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">continues_statistic</code><span class="sig-paren">(</span><em>mean=None</em>, <em>min_val=None</em>, <em>max_val=None</em>, <em>quantifier=0</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic" title="Permalink to this definition">¶</a></dt>
181
+<dd><p>This class stores a statistic for a stream of values. The statistic includes: mean, min, max, quantifier.</p>
182
+<div class="admonition note">
183
+<p class="first admonition-title">Note</p>
184
+<p class="last">You can use the mathematic operators “+, +=” to add a value to the statistic.</p>
185
+</div>
186
+<table class="docutils field-list" frame="void" rules="none">
187
+<col class="field-name" />
188
+<col class="field-body" />
189
+<tbody valign="top">
190
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
191
+<li><strong>mean</strong> (<em>numeric</em>) – The mean start value, the start value or None.</li>
192
+<li><strong>min_val</strong> (<em>numeric</em>) – The min start value or None</li>
193
+<li><strong>max_val</strong> (<em>numeric</em>) – The max start value or None</li>
194
+<li><strong>quantifier</strong> (<em>int</em>) – The quantifier start value or 0</li>
195
+</ul>
196
+</td>
197
+</tr>
198
+</tbody>
199
+</table>
200
+<div class="admonition note">
201
+<p class="first admonition-title">Note</p>
202
+<p>You are able to initialise this class in the following ways:</p>
203
+<ul class="last simple">
204
+<li>Without arguments to get an empty instance</li>
205
+<li>With one single value to get an starting instance</li>
206
+<li>With mean, min_val, max_val, quantifier to initialise an existing statistic</li>
207
+</ul>
208
+</div>
209
+<p><strong>Example:</strong></p>
210
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
211
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
212
+
213
+<span class="kn">import</span> <span class="nn">helpers</span>
214
+
215
+
216
+<span class="n">cs</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic</span><span class="p">()</span>
217
+<span class="k">for</span> <span class="n">val</span> <span class="ow">in</span> <span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">4</span><span class="p">):</span>
218
+    <span class="n">cs</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic</span><span class="p">(</span><span class="n">val</span><span class="p">)</span>
219
+    <span class="nb">print</span><span class="p">(</span><span class="n">cs</span><span class="p">)</span>
220
+</pre></div>
221
+</div>
222
+<p>Will result to the following output:</p>
223
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mean</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">1</span>
224
+<span class="n">mean</span><span class="o">=</span><span class="mf">2.0</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">2</span>
225
+<span class="n">mean</span><span class="o">=</span><span class="mf">3.0</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">3</span>
226
+<span class="n">mean</span><span class="o">=</span><span class="mf">3.25</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">4</span>
227
+</pre></div>
228
+</div>
229
+<dl class="attribute">
230
+<dt id="helpers.continues_statistic.max">
231
+<code class="descname">max</code><a class="headerlink" href="#helpers.continues_statistic.max" title="Permalink to this definition">¶</a></dt>
232
+<dd><p>The current max value.</p>
233
+</dd></dl>
234
+
235
+<dl class="attribute">
236
+<dt id="helpers.continues_statistic.mean">
237
+<code class="descname">mean</code><a class="headerlink" href="#helpers.continues_statistic.mean" title="Permalink to this definition">¶</a></dt>
238
+<dd><p>The current mean value.</p>
239
+</dd></dl>
240
+
241
+<dl class="attribute">
242
+<dt id="helpers.continues_statistic.min">
243
+<code class="descname">min</code><a class="headerlink" href="#helpers.continues_statistic.min" title="Permalink to this definition">¶</a></dt>
244
+<dd><p>The current min value.</p>
245
+</dd></dl>
246
+
247
+<dl class="method">
248
+<dt id="helpers.continues_statistic.pop">
249
+<code class="descname">pop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic.pop" title="Permalink to this definition">¶</a></dt>
250
+<dd><p>This pops out the current statistic data and returns these as an instance of <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
251
+<table class="docutils field-list" frame="void" rules="none">
252
+<col class="field-name" />
253
+<col class="field-body" />
254
+<tbody valign="top">
255
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The current statistic or None, if no value is available.</td>
256
+</tr>
257
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a> or None</td>
258
+</tr>
259
+</tbody>
260
+</table>
261
+</dd></dl>
262
+
263
+<dl class="attribute">
264
+<dt id="helpers.continues_statistic.quantifier">
265
+<code class="descname">quantifier</code><a class="headerlink" href="#helpers.continues_statistic.quantifier" title="Permalink to this definition">¶</a></dt>
266
+<dd><p>The current quantifier (number of values for continues statistic).</p>
267
+</dd></dl>
268
+
269
+</dd></dl>
270
+
271
+<dl class="class">
272
+<dt id="helpers.continues_statistic_multivalue">
273
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">continues_statistic_multivalue</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic_multivalue" title="Permalink to this definition">¶</a></dt>
274
+<dd><p>This class stores multiple statistics of stream values. The statistic of each value is stored as <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
275
+<div class="admonition note">
276
+<p class="first admonition-title">Note</p>
277
+<p class="last">You can use the mathematic operators “+, +=” to add instances.</p>
278
+</div>
279
+<div class="admonition note">
280
+<p class="first admonition-title">Note</p>
281
+<p>You are able to initialise this class in the following ways:</p>
282
+<ul class="last simple">
283
+<li>Without arguments to get an empty instance</li>
284
+<li>With a keword argument(s) which will be passed to <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">continues_statistic</span></code></a></li>
285
+<li>With a dict equivalent of <a class="reference internal" href="#helpers.continues_statistic_multivalue" title="helpers.continues_statistic_multivalue"><code class="xref py py-class docutils literal notranslate"><span class="pre">continues_statistic_multivalue</span></code></a> to initialise an existing statistic</li>
286
+</ul>
287
+</div>
288
+<p><strong>Example:</strong></p>
289
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
290
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
291
+
292
+<span class="kn">import</span> <span class="nn">helpers</span>
293
+
294
+
295
+<span class="n">csm</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">()</span>
296
+<span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
297
+<span class="n">csm</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;mean&#39;</span><span class="p">:</span> <span class="mf">3.1</span><span class="p">,</span> <span class="s1">&#39;min_val&#39;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;max_val&#39;</span><span class="p">:</span> <span class="mf">3.5</span><span class="p">,</span> <span class="s1">&#39;quantifier&#39;</span><span class="p">:</span> <span class="mi">305</span><span class="p">})</span>
298
+<span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
299
+<span class="n">csm</span> <span class="o">+=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="n">a</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">b</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;mean&#39;</span><span class="p">:</span> <span class="mf">17.1</span><span class="p">,</span> <span class="s1">&#39;min_val&#39;</span><span class="p">:</span> <span class="mf">13.1</span><span class="p">,</span> <span class="s1">&#39;max_val&#39;</span><span class="p">:</span> <span class="mf">19.3</span><span class="p">,</span> <span class="s1">&#39;quantifier&#39;</span><span class="p">:</span> <span class="mi">27</span><span class="p">})</span>
300
+<span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
301
+<span class="nb">print</span><span class="p">(</span><span class="n">helpers</span><span class="o">.</span><span class="n">continues_statistic_multivalue</span><span class="p">(</span><span class="nb">dict</span><span class="p">(</span><span class="n">csm</span><span class="p">)),</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
302
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;pop out b:&#39;</span><span class="p">,</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;b&#39;</span><span class="p">),</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
303
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;pop out b:&#39;</span><span class="p">,</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;b&#39;</span><span class="p">),</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
304
+<span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
305
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;pop out all:</span><span class="se">\n</span><span class="si">%s</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(),</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
306
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;pop out all:</span><span class="se">\n</span><span class="si">%s</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="n">csm</span><span class="o">.</span><span class="n">pop</span><span class="p">(),</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
307
+<span class="nb">print</span><span class="p">(</span><span class="n">csm</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
308
+</pre></div>
309
+</div>
310
+<p>Will result to the following output:</p>
311
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> 
312
+<span class="o">--------------------------------------------------------------</span>
313
+<span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">3.5</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">305</span> 
314
+<span class="o">--------------------------------------------------------------</span>
315
+<span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span>
316
+<span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span> 
317
+<span class="o">--------------------------------------------------------------</span>
318
+<span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span>
319
+<span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span> 
320
+<span class="o">--------------------------------------------------------------</span>
321
+<span class="n">pop</span> <span class="n">out</span> <span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">17.1</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mf">13.1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">19.3</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">27</span> 
322
+<span class="o">--------------------------------------------------------------</span>
323
+<span class="n">pop</span> <span class="n">out</span> <span class="n">b</span><span class="p">:</span> <span class="kc">None</span> 
324
+<span class="o">--------------------------------------------------------------</span>
325
+<span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">0</span>
326
+<span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span> 
327
+<span class="o">--------------------------------------------------------------</span>
328
+<span class="n">pop</span> <span class="n">out</span> <span class="nb">all</span><span class="p">:</span>
329
+<span class="n">b</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">0</span>
330
+<span class="n">a</span><span class="p">:</span> <span class="n">mean</span><span class="o">=</span><span class="mf">3.103954248366013</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mf">4.31</span><span class="p">,</span> <span class="n">quantifier</span><span class="o">=</span><span class="mi">306</span> 
331
+<span class="o">--------------------------------------------------------------</span>
332
+<span class="n">pop</span> <span class="n">out</span> <span class="nb">all</span><span class="p">:</span>
333
+<span class="kc">None</span> 
334
+<span class="o">--------------------------------------------------------------</span>
335
+<span class="o">-</span> 
336
+<span class="o">--------------------------------------------------------------</span>
337
+</pre></div>
338
+</div>
339
+<dl class="method">
340
+<dt id="helpers.continues_statistic_multivalue.pop">
341
+<code class="descname">pop</code><span class="sig-paren">(</span><em>key=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.continues_statistic_multivalue.pop" title="Permalink to this definition">¶</a></dt>
342
+<dd><p>This pops out the current statistic data for a given key and returns these as an instance of <a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a>.</p>
343
+<p>If no key is given it pops out the current statistic data and returns these as an instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic_multiple</span></code>.</p>
344
+<table class="docutils field-list" frame="void" rules="none">
345
+<col class="field-name" />
346
+<col class="field-body" />
347
+<tbody valign="top">
348
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>key</strong> (<em>str</em><em> or </em><em>NoneType</em>) – The key to get data for</td>
349
+</tr>
350
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The current statistic or None, if no value is available.</td>
351
+</tr>
352
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference internal" href="#helpers.continues_statistic" title="helpers.continues_statistic"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.continues_statistic</span></code></a> or None</td>
353
+</tr>
354
+</tbody>
355
+</table>
356
+</dd></dl>
357
+
358
+</dd></dl>
359
+
360
+<dl class="class">
361
+<dt id="helpers.direct_socket_base">
362
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_base</code><span class="sig-paren">(</span><em>max_len=None</em>, <em>virtual_rate_bps=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base" title="Permalink to this definition">¶</a></dt>
363
+<dd><p>This is the base class for other classes in this module.</p>
364
+<dl class="method">
365
+<dt id="helpers.direct_socket_base.disconnect">
366
+<code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.disconnect" title="Permalink to this definition">¶</a></dt>
367
+<dd><p>Method to disconnect client and server.</p>
368
+</dd></dl>
369
+
370
+<dl class="method">
371
+<dt id="helpers.direct_socket_base.init_channel_name">
372
+<code class="descname">init_channel_name</code><span class="sig-paren">(</span><em>channel_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.init_channel_name" title="Permalink to this definition">¶</a></dt>
373
+<dd><p>With this Method, the channel name for logging can be changed.</p>
374
+<table class="docutils field-list" frame="void" rules="none">
375
+<col class="field-name" />
376
+<col class="field-body" />
377
+<tbody valign="top">
378
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>channel_name</strong> (<em>str</em>) – The name for the logging channel</td>
379
+</tr>
380
+</tbody>
381
+</table>
382
+</dd></dl>
383
+
384
+<dl class="method">
385
+<dt id="helpers.direct_socket_base.is_connected">
386
+<code class="descname">is_connected</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.is_connected" title="Permalink to this definition">¶</a></dt>
387
+<dd><p>With this Method the connection status can be identified.</p>
388
+<table class="docutils field-list" frame="void" rules="none">
389
+<col class="field-name" />
390
+<col class="field-body" />
391
+<tbody valign="top">
392
+<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">True, if a connection is established, otherwise False.</td>
393
+</tr>
394
+<tr class="field-even field"><th class="field-name">Return type:</th><td class="field-body">bool</td>
395
+</tr>
396
+</tbody>
397
+</table>
398
+</dd></dl>
399
+
400
+<dl class="method">
401
+<dt id="helpers.direct_socket_base.receive">
402
+<code class="descname">receive</code><span class="sig-paren">(</span><em>timeout=1.0</em>, <em>num=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.receive" title="Permalink to this definition">¶</a></dt>
403
+<dd><p>This method returns received data.</p>
404
+<table class="docutils field-list" frame="void" rules="none">
405
+<col class="field-name" />
406
+<col class="field-body" />
407
+<tbody valign="top">
408
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
409
+<li><strong>timeout</strong> (<em>float</em>) – The timeout for receiving data (at least after the timeout the method returns data or None).</li>
410
+<li><strong>num</strong> (<em>int</em><em> or </em><em>None</em>) – the number of bytes to receive (use None to get all available data).</li>
411
+</ul>
412
+</td>
413
+</tr>
414
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The received data.</p>
415
+</td>
416
+</tr>
417
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bytes</p>
418
+</td>
419
+</tr>
420
+</tbody>
421
+</table>
422
+</dd></dl>
423
+
424
+<dl class="method">
425
+<dt id="helpers.direct_socket_base.register_callback">
426
+<code class="descname">register_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_callback" title="Permalink to this definition">¶</a></dt>
427
+<dd><p>This method stores the callback which is executed, if data is available. You need to execute <a class="reference internal" href="#helpers.direct_socket_base.receive" title="helpers.direct_socket_base.receive"><code class="xref py py-func docutils literal notranslate"><span class="pre">receive()</span></code></a> of this instance
428
+given as first argument.</p>
429
+<table class="docutils field-list" frame="void" rules="none">
430
+<col class="field-name" />
431
+<col class="field-body" />
432
+<tbody valign="top">
433
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, when data is available.</td>
434
+</tr>
435
+</tbody>
436
+</table>
437
+</dd></dl>
438
+
439
+<dl class="method">
440
+<dt id="helpers.direct_socket_base.register_connect_callback">
441
+<code class="descname">register_connect_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_connect_callback" title="Permalink to this definition">¶</a></dt>
442
+<dd><p>This method stores the callback which is executed, if a connection is established.</p>
443
+<table class="docutils field-list" frame="void" rules="none">
444
+<col class="field-name" />
445
+<col class="field-body" />
446
+<tbody valign="top">
447
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, when a connection is established.</td>
448
+</tr>
449
+</tbody>
450
+</table>
451
+</dd></dl>
452
+
453
+<dl class="method">
454
+<dt id="helpers.direct_socket_base.register_disconnect_callback">
455
+<code class="descname">register_disconnect_callback</code><span class="sig-paren">(</span><em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.register_disconnect_callback" title="Permalink to this definition">¶</a></dt>
456
+<dd><p>This method stores the callback which is executed, after the connection is lost.</p>
457
+<table class="docutils field-list" frame="void" rules="none">
458
+<col class="field-name" />
459
+<col class="field-body" />
460
+<tbody valign="top">
461
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>callback</strong> – The callback which will be executed, after the connection is lost.</td>
462
+</tr>
463
+</tbody>
464
+</table>
465
+</dd></dl>
466
+
467
+<dl class="method">
468
+<dt id="helpers.direct_socket_base.send">
469
+<code class="descname">send</code><span class="sig-paren">(</span><em>data</em>, <em>timeout=1.0</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_base.send" title="Permalink to this definition">¶</a></dt>
470
+<dd><p>This method sends data via the initiated communication channel.</p>
471
+<table class="docutils field-list" frame="void" rules="none">
472
+<col class="field-name" />
473
+<col class="field-body" />
474
+<tbody valign="top">
475
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
476
+<li><strong>data</strong> (<em>bytes</em>) – The data to be send over the communication channel.</li>
477
+<li><strong>timeout</strong> (<em>float</em>) – The timeout for sending data (e.g. time to establish new connection).</li>
478
+<li><strong>log_lvl</strong> (<em>int</em>) – The log level to log outgoing TX-data</li>
479
+</ul>
480
+</td>
481
+</tr>
482
+<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">True if data had been sent, otherwise False.</p>
483
+</td>
484
+</tr>
485
+<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bool</p>
486
+</td>
487
+</tr>
488
+</tbody>
489
+</table>
490
+</dd></dl>
491
+
492
+</dd></dl>
493
+
494
+<dl class="class">
495
+<dt id="helpers.direct_socket_client">
496
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_client</code><span class="sig-paren">(</span><em>max_len=None</em>, <em>virtual_rate_bps=None</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client" title="Permalink to this definition">¶</a></dt>
497
+<dd><p>Class to create a direct client socket. See also parent <a class="reference internal" href="#helpers.direct_socket_base" title="helpers.direct_socket_base"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_base</span></code></a>.</p>
498
+<p><strong>Example:</strong></p>
499
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
500
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
501
+
502
+<span class="kn">import</span> <span class="nn">report</span>
503
+<span class="kn">import</span> <span class="nn">helpers</span>
504
+<span class="kn">import</span> <span class="nn">time</span>
505
+
506
+
507
+<span class="k">def</span> <span class="nf">mirror_callback</span><span class="p">(</span><span class="n">sock</span><span class="p">):</span>
508
+    <span class="n">sock</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">sock</span><span class="o">.</span><span class="n">receive</span><span class="p">())</span>
509
+
510
+
511
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
512
+<span class="n">s</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_server</span><span class="p">(</span><span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
513
+<span class="n">s</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">&#39;example_server&#39;</span><span class="p">)</span>
514
+<span class="n">s</span><span class="o">.</span><span class="n">register_callback</span><span class="p">(</span><span class="n">mirror_callback</span><span class="p">)</span>
515
+<span class="n">c</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_client</span><span class="p">(</span><span class="n">max_len</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
516
+<span class="n">c</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">&#39;example_client&#39;</span><span class="p">)</span>
517
+<span class="n">c</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
518
+<span class="n">c</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;abc&#39;</span><span class="p">)</span>
519
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;The Client received: </span><span class="si">%s</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">repr</span><span class="p">(</span><span class="n">c</span><span class="o">.</span><span class="n">receive</span><span class="p">()))</span>
520
+</pre></div>
521
+</div>
522
+<p>Will result to the following output:</p>
523
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
524
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Waiting</span> <span class="k">for</span> <span class="n">incomming</span> <span class="n">connection</span>
525
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
526
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
527
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
528
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
529
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
530
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
531
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">321</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
532
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">322</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
533
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">322</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
534
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">523</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
535
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">723</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
536
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">723</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
537
+<span class="n">The</span> <span class="n">Client</span> <span class="n">received</span><span class="p">:</span> <span class="sa">b</span><span class="s1">&#39;ab&#39;</span>
538
+</pre></div>
539
+</div>
540
+<dl class="method">
541
+<dt id="helpers.direct_socket_client.connect">
542
+<code class="descname">connect</code><span class="sig-paren">(</span><em>remote_socket</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client.connect" title="Permalink to this definition">¶</a></dt>
543
+<dd><p>Method to create a connection between this client and a <a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a> instance.</p>
544
+<table class="docutils field-list" frame="void" rules="none">
545
+<col class="field-name" />
546
+<col class="field-body" />
547
+<tbody valign="top">
548
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>remote_socket</strong> (<a class="reference internal" href="#helpers.direct_socket_server" title="helpers.direct_socket_server"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_server</span></code></a>) – The remote socket to connect to.</td>
549
+</tr>
550
+</tbody>
551
+</table>
552
+</dd></dl>
553
+
554
+<dl class="method">
555
+<dt id="helpers.direct_socket_client.reconnect">
556
+<code class="descname">reconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_client.reconnect" title="Permalink to this definition">¶</a></dt>
557
+<dd><p>Method to do a reconnect.</p>
558
+<div class="admonition note">
559
+<p class="first admonition-title">Note</p>
560
+<p class="last">The <code class="xref py py-const docutils literal notranslate"><span class="pre">remote_socket</span></code> of the prefious <a class="reference internal" href="#helpers.direct_socket_client.connect" title="helpers.direct_socket_client.connect"><code class="xref py py-func docutils literal notranslate"><span class="pre">connect()</span></code></a> call will be used.</p>
561
+</div>
562
+</dd></dl>
563
+
564
+</dd></dl>
565
+
566
+<dl class="class">
567
+<dt id="helpers.direct_socket_server">
568
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">direct_socket_server</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.direct_socket_server" title="Permalink to this definition">¶</a></dt>
569
+<dd><p>Class to create a direct server socket. See also parent <a class="reference internal" href="#helpers.direct_socket_base" title="helpers.direct_socket_base"><code class="xref py py-class docutils literal notranslate"><span class="pre">helpers.direct_socket_base</span></code></a>.</p>
570
+<p><strong>Example:</strong></p>
571
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
572
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
573
+
574
+<span class="kn">import</span> <span class="nn">report</span>
575
+<span class="kn">import</span> <span class="nn">helpers</span>
576
+<span class="kn">import</span> <span class="nn">time</span>
577
+
578
+
579
+<span class="k">def</span> <span class="nf">mirror_callback</span><span class="p">(</span><span class="n">sock</span><span class="p">):</span>
580
+    <span class="n">sock</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="n">sock</span><span class="o">.</span><span class="n">receive</span><span class="p">())</span>
581
+
582
+
583
+<span class="n">report</span><span class="o">.</span><span class="n">stdoutLoggingConfigure</span><span class="p">(</span><span class="n">log_name_lvl</span><span class="o">=</span><span class="p">[(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;DEBUG&#39;</span><span class="p">),</span> <span class="p">])</span>
584
+<span class="n">s</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_server</span><span class="p">(</span><span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
585
+<span class="n">s</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">&#39;example_server&#39;</span><span class="p">)</span>
586
+<span class="n">s</span><span class="o">.</span><span class="n">register_callback</span><span class="p">(</span><span class="n">mirror_callback</span><span class="p">)</span>
587
+<span class="n">c</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">direct_socket_client</span><span class="p">(</span><span class="n">max_len</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">virtual_rate_bps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
588
+<span class="n">c</span><span class="o">.</span><span class="n">init_channel_name</span><span class="p">(</span><span class="s1">&#39;example_client&#39;</span><span class="p">)</span>
589
+<span class="n">c</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
590
+<span class="n">c</span><span class="o">.</span><span class="n">send</span><span class="p">(</span><span class="sa">b</span><span class="s1">&#39;abc&#39;</span><span class="p">)</span>
591
+<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;The Client received: </span><span class="si">%s</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="nb">repr</span><span class="p">(</span><span class="n">c</span><span class="o">.</span><span class="n">receive</span><span class="p">()))</span>
592
+</pre></div>
593
+</div>
594
+<p>Will result to the following output:</p>
595
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
596
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Waiting</span> <span class="k">for</span> <span class="n">incomming</span> <span class="n">connection</span>
597
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">all_others</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
598
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">920</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
599
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
600
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Connection</span> <span class="n">established</span><span class="o">...</span>
601
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">INFO</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">Cleaning</span> <span class="n">RX</span><span class="o">-</span><span class="n">Buffer</span><span class="o">...</span>
602
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">47</span><span class="p">,</span><span class="mi">921</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
603
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">321</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
604
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">322</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
605
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">322</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
606
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">523</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
607
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">723</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_client</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Client</span><span class="p">:</span> <span class="n">RX</span> <span class="o">&lt;-</span> <span class="p">(</span><span class="mi">2</span><span class="p">):</span> <span class="mi">61</span> <span class="mi">62</span>
608
+<span class="mi">2021</span><span class="o">-</span><span class="mi">01</span><span class="o">-</span><span class="mi">09</span> <span class="mi">22</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">48</span><span class="p">,</span><span class="mi">723</span><span class="p">:</span> <span class="n">root</span><span class="o">.</span><span class="n">helpers</span><span class="o">.</span><span class="n">example_server</span> <span class="o">-</span> <span class="n">DEBUG</span> <span class="o">-</span> <span class="n">Server</span><span class="p">:</span> <span class="n">TX</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="mi">1</span><span class="p">):</span> <span class="mi">63</span>
609
+<span class="n">The</span> <span class="n">Client</span> <span class="n">received</span><span class="p">:</span> <span class="sa">b</span><span class="s1">&#39;ab&#39;</span>
610
+</pre></div>
611
+</div>
612
+</dd></dl>
613
+
614
+<dl class="class">
615
+<dt id="helpers.ringbuffer">
616
+<em class="property">class </em><code class="descclassname">helpers.</code><code class="descname">ringbuffer</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer" title="Permalink to this definition">¶</a></dt>
617
+<dd><p>Class for a list with a limited number of elements.</p>
618
+<div class="admonition note">
619
+<p class="first admonition-title">Note</p>
620
+<p class="last">On adding Objects, the list will be reduced to the maximum length by deleting entries starting from index 0.</p>
621
+</div>
622
+<p><strong>Example:</strong></p>
623
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">sys</span>
624
+<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s1">&#39;../..&#39;</span><span class="p">)</span>
625
+
626
+<span class="kn">import</span> <span class="nn">helpers</span>
627
+
628
+
629
+<span class="n">rb</span> <span class="o">=</span> <span class="n">helpers</span><span class="o">.</span><span class="n">ringbuffer</span><span class="p">(</span><span class="n">length</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
630
+<span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
631
+<span class="n">rb</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
632
+<span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
633
+<span class="n">rb</span><span class="o">.</span><span class="n">extend</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span><span class="p">,</span><span class="mi">3</span><span class="p">,</span><span class="mi">4</span><span class="p">,</span><span class="mi">5</span><span class="p">,</span><span class="mi">6</span><span class="p">))</span>
634
+<span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
635
+<span class="n">rb</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span>
636
+<span class="nb">print</span><span class="p">(</span><span class="n">rb</span><span class="p">,</span> <span class="s1">&#39;</span><span class="se">\n</span><span class="s1">--------------------------------------------------------------&#39;</span><span class="p">)</span>
637
+</pre></div>
638
+</div>
639
+<p>Will result to the following output:</p>
640
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[]</span> 
641
+<span class="o">--------------------------------------------------------------</span>
642
+<span class="p">[</span><span class="mi">0</span><span class="p">]</span> 
643
+<span class="o">--------------------------------------------------------------</span>
644
+<span class="p">[</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">]</span> 
645
+<span class="o">--------------------------------------------------------------</span>
646
+<span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">17</span><span class="p">]</span> 
647
+<span class="o">--------------------------------------------------------------</span>
648
+</pre></div>
649
+</div>
650
+<dl class="method">
651
+<dt id="helpers.ringbuffer.append">
652
+<code class="descname">append</code><span class="sig-paren">(</span><em>obj</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer.append" title="Permalink to this definition">¶</a></dt>
653
+<dd><p>Append object to the end of the list.</p>
654
+</dd></dl>
655
+
656
+<dl class="method">
657
+<dt id="helpers.ringbuffer.extend">
658
+<code class="descname">extend</code><span class="sig-paren">(</span><em>iterable</em><span class="sig-paren">)</span><a class="headerlink" href="#helpers.ringbuffer.extend" title="Permalink to this definition">¶</a></dt>
659
+<dd><p>Extend list by appending elements from the iterable.</p>
660
+</dd></dl>
661
+
662
+</dd></dl>
663
+
664
+</div>
665
+<div class="toctree-wrapper compound">
666
+</div>
667
+</div>
668
+<div class="section" id="indices-and-tables">
669
+<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
670
+<ul class="simple">
671
+<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
672
+<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
673
+<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
674
+</ul>
675
+</div>
676
+
677
+
678
+           </div>
679
+           
680
+          </div>
681
+          <footer>
682
+  
683
+
684
+  <hr/>
685
+
686
+  <div role="contentinfo">
687
+    <p>
688
+        
689
+        &copy; Copyright 2021, Dirk Alders
690
+
691
+    </p>
692
+  </div>
693
+    
694
+    
695
+    
696
+    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
697
+    
698
+    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
699
+    
700
+    provided by <a href="https://readthedocs.org">Read the Docs</a>. 
701
+
702
+</footer>
703
+
704
+        </div>
705
+      </div>
706
+
707
+    </section>
708
+
709
+  </div>
710
+  
711
+
712
+  <script type="text/javascript">
713
+      jQuery(function () {
714
+          SphinxRtdTheme.Navigation.enable(true);
715
+      });
716
+  </script>
717
+
718
+  
719
+  
720
+    
721
+   
722
+
723
+</body>
724
+</html>

+ 5
- 0
_docs_/objects.inv 查看文件

@@ -0,0 +1,5 @@
1
+# Sphinx inventory version 2
2
+# Project: helpers
3
+# Version: 
4
+# The remainder of this file is compressed using zlib.
5
+xÚ­•Anà E÷>U»µÕlsƒ.*Uê¢K4ƃËQ²ë5z½ž¤8$Š«VJŒ»³>ÿý�L‡f@Ob8¬{׃âQhÛà¾ê¸7÷I+DYtÉY)gYÛ€$‰�5±V#­‰Õ¾BU=ìG˜½®ãLÁ.ÁõzpñeÈ�kæ¡ï¢¸ÑèóëË>Ö;0óz?	¸u-�ö¨X’S[dYÝRú7%Š²QΫZi«Yªb†‘zÌÍ!yš6™Q@½Ãlº�›�^*0¦µ]œ“–óoy—­ZIh3z¬ŒF˳�YªìSv⣔›@èwé~_™¸×¶­Ãf3Ó\Á0ÜØÑ	„{¾µh�Š nÖj4¢\‰³zô‰§ñ³¸Ø§FÓÄñ†F¹x-Ù‰Ó,¾>>IDcèccã/ÈÙ»">-Ôåy …=§W)U%¯ºŸDÒ’ù5�¿@‹Å7& }ü

+ 216
- 0
_docs_/py-modindex.html 查看文件

@@ -0,0 +1,216 @@
1
+
2
+
3
+<!DOCTYPE html>
4
+<html class="writer-html4" lang="en" >
5
+<head>
6
+  <meta charset="utf-8">
7
+  
8
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+  
10
+  <title>Python Module Index &mdash; helpers  documentation</title>
11
+  
12
+
13
+  
14
+  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
15
+  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16
+
17
+  
18
+  
19
+  
20
+  
21
+
22
+  
23
+  <!--[if lt IE 9]>
24
+    <script src="_static/js/html5shiv.min.js"></script>
25
+  <![endif]-->
26
+  
27
+    
28
+      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
29
+        <script type="text/javascript" src="_static/jquery.js"></script>
30
+        <script type="text/javascript" src="_static/underscore.js"></script>
31
+        <script type="text/javascript" src="_static/doctools.js"></script>
32
+        <script type="text/javascript" src="_static/language_data.js"></script>
33
+    
34
+    <script type="text/javascript" src="_static/js/theme.js"></script>
35
+
36
+    
37
+    <link rel="index" title="Index" href="genindex.html" />
38
+    <link rel="search" title="Search" href="search.html" />
39
+ 
40
+
41
+    <script type="text/javascript">
42
+      DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true;
43
+    </script>
44
+
45
+
46
+</head>
47
+
48
+<body class="wy-body-for-nav">
49
+
50
+   
51
+  <div class="wy-grid-for-nav">
52
+    
53
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
54
+      <div class="wy-side-scroll">
55
+        <div class="wy-side-nav-search" >
56
+          
57
+
58
+          
59
+            <a href="index.html" class="icon icon-home" alt="Documentation Home"> helpers
60
+          
61
+
62
+          
63
+          </a>
64
+
65
+          
66
+            
67
+            
68
+          
69
+
70
+          
71
+<div role="search">
72
+  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
73
+    <input type="text" name="q" placeholder="Search docs" />
74
+    <input type="hidden" name="check_keywords" value="yes" />
75
+    <input type="hidden" name="area" value="default" />
76
+  </form>
77
+</div>
78
+
79
+          
80
+        </div>
81
+
82
+        
83
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
84
+          
85
+            
86
+            
87
+              
88
+            
89
+            
90
+              <!-- Local TOC -->
91
+              <div class="local-toc"></div>
92
+            
93
+          
94
+        </div>
95
+        
96
+      </div>
97
+    </nav>
98
+
99
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
100
+
101
+      
102
+      <nav class="wy-nav-top" aria-label="top navigation">
103
+        
104
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
105
+          <a href="index.html">helpers</a>
106
+        
107
+      </nav>
108
+
109
+
110
+      <div class="wy-nav-content">
111
+        
112
+        <div class="rst-content">
113
+        
114
+          
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+<div role="navigation" aria-label="breadcrumbs navigation">
131
+
132
+  <ul class="wy-breadcrumbs">
133
+    
134
+      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
135
+        
136
+      <li>Python Module Index</li>
137
+    
138
+    
139
+      <li class="wy-breadcrumbs-aside">
140
+        
141
+      </li>
142
+    
143
+  </ul>
144
+
145
+  
146
+  <hr/>
147
+</div>
148
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
149
+           <div itemprop="articleBody">
150
+            
151
+
152
+   <h1>Python Module Index</h1>
153
+
154
+   <div class="modindex-jumpbox">
155
+   <a href="#cap-h"><strong>h</strong></a>
156
+   </div>
157
+
158
+   <table class="indextable modindextable">
159
+     <tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
160
+     <tr class="cap" id="cap-h"><td></td><td>
161
+       <strong>h</strong></td><td></td></tr>
162
+     <tr>
163
+       <td></td>
164
+       <td>
165
+       <a href="index.html#module-helpers"><code class="xref">helpers</code></a></td><td>
166
+       <em></em></td></tr>
167
+   </table>
168
+
169
+
170
+           </div>
171
+           
172
+          </div>
173
+          <footer>
174
+  
175
+
176
+  <hr/>
177
+
178
+  <div role="contentinfo">
179
+    <p>
180
+        
181
+        &copy; Copyright 2021, Dirk Alders
182
+
183
+    </p>
184
+  </div>
185
+    
186
+    
187
+    
188
+    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
189
+    
190
+    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
191
+    
192
+    provided by <a href="https://readthedocs.org">Read the Docs</a>. 
193
+
194
+</footer>
195
+
196
+        </div>
197
+      </div>
198
+
199
+    </section>
200
+
201
+  </div>
202
+  
203
+
204
+  <script type="text/javascript">
205
+      jQuery(function () {
206
+          SphinxRtdTheme.Navigation.enable(true);
207
+      });
208
+  </script>
209
+
210
+  
211
+  
212
+    
213
+   
214
+
215
+</body>
216
+</html>

+ 214
- 0
_docs_/search.html 查看文件

@@ -0,0 +1,214 @@
1
+
2
+
3
+<!DOCTYPE html>
4
+<html class="writer-html4" lang="en" >
5
+<head>
6
+  <meta charset="utf-8">
7
+  
8
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+  
10
+  <title>Search &mdash; helpers  documentation</title>
11
+  
12
+
13
+  
14
+  <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
15
+  <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16
+
17
+  
18
+  
19
+  
20
+  
21
+
22
+  
23
+    
24
+  <!--[if lt IE 9]>
25
+    <script src="_static/js/html5shiv.min.js"></script>
26
+  <![endif]-->
27
+  
28
+    
29
+      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
30
+        <script type="text/javascript" src="_static/jquery.js"></script>
31
+        <script type="text/javascript" src="_static/underscore.js"></script>
32
+        <script type="text/javascript" src="_static/doctools.js"></script>
33
+        <script type="text/javascript" src="_static/language_data.js"></script>
34
+    
35
+    <script type="text/javascript" src="_static/js/theme.js"></script>
36
+
37
+    
38
+    <script type="text/javascript" src="_static/searchtools.js"></script>
39
+    <link rel="index" title="Index" href="genindex.html" />
40
+    <link rel="search" title="Search" href="#" /> 
41
+</head>
42
+
43
+<body class="wy-body-for-nav">
44
+
45
+   
46
+  <div class="wy-grid-for-nav">
47
+    
48
+    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49
+      <div class="wy-side-scroll">
50
+        <div class="wy-side-nav-search" >
51
+          
52
+
53
+          
54
+            <a href="index.html" class="icon icon-home" alt="Documentation Home"> helpers
55
+          
56
+
57
+          
58
+          </a>
59
+
60
+          
61
+            
62
+            
63
+          
64
+
65
+          
66
+<div role="search">
67
+  <form id="rtd-search-form" class="wy-form" action="#" method="get">
68
+    <input type="text" name="q" placeholder="Search docs" />
69
+    <input type="hidden" name="check_keywords" value="yes" />
70
+    <input type="hidden" name="area" value="default" />
71
+  </form>
72
+</div>
73
+
74
+          
75
+        </div>
76
+
77
+        
78
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
79
+          
80
+            
81
+            
82
+              
83
+            
84
+            
85
+              <!-- Local TOC -->
86
+              <div class="local-toc"></div>
87
+            
88
+          
89
+        </div>
90
+        
91
+      </div>
92
+    </nav>
93
+
94
+    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
95
+
96
+      
97
+      <nav class="wy-nav-top" aria-label="top navigation">
98
+        
99
+          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
100
+          <a href="index.html">helpers</a>
101
+        
102
+      </nav>
103
+
104
+
105
+      <div class="wy-nav-content">
106
+        
107
+        <div class="rst-content">
108
+        
109
+          
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+<div role="navigation" aria-label="breadcrumbs navigation">
126
+
127
+  <ul class="wy-breadcrumbs">
128
+    
129
+      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
130
+        
131
+      <li>Search</li>
132
+    
133
+    
134
+      <li class="wy-breadcrumbs-aside">
135
+        
136
+            
137
+        
138
+      </li>
139
+    
140
+  </ul>
141
+
142
+  
143
+  <hr/>
144
+</div>
145
+          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
146
+           <div itemprop="articleBody">
147
+            
148
+  <noscript>
149
+  <div id="fallback" class="admonition warning">
150
+    <p class="last">
151
+      Please activate JavaScript to enable the search functionality.
152
+    </p>
153
+  </div>
154
+  </noscript>
155
+
156
+  
157
+  <div id="search-results">
158
+  
159
+  </div>
160
+
161
+           </div>
162
+           
163
+          </div>
164
+          <footer>
165
+  
166
+
167
+  <hr/>
168
+
169
+  <div role="contentinfo">
170
+    <p>
171
+        
172
+        &copy; Copyright 2021, Dirk Alders
173
+
174
+    </p>
175
+  </div>
176
+    
177
+    
178
+    
179
+    Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a
180
+    
181
+    <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a>
182
+    
183
+    provided by <a href="https://readthedocs.org">Read the Docs</a>. 
184
+
185
+</footer>
186
+
187
+        </div>
188
+      </div>
189
+
190
+    </section>
191
+
192
+  </div>
193
+  
194
+
195
+  <script type="text/javascript">
196
+      jQuery(function () {
197
+          SphinxRtdTheme.Navigation.enable(true);
198
+      });
199
+  </script>
200
+
201
+  
202
+  
203
+    
204
+  
205
+  <script type="text/javascript">
206
+    jQuery(function() { Search.loadIndex("searchindex.js"); });
207
+  </script>
208
+  
209
+  <script type="text/javascript" id="searchindexloader"></script>
210
+   
211
+
212
+
213
+</body>
214
+</html>

+ 1
- 0
_docs_/searchindex.js 查看文件

@@ -0,0 +1 @@
1
+Search.setIndex({docnames:["index"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,sphinx:55},filenames:["index.rst"],objects:{"":{helpers:[0,0,0,"-"]},"helpers.continues_statistic":{max:[0,2,1,""],mean:[0,2,1,""],min:[0,2,1,""],pop:[0,3,1,""],quantifier:[0,2,1,""]},"helpers.continues_statistic_multivalue":{pop:[0,3,1,""]},"helpers.direct_socket_base":{disconnect:[0,3,1,""],init_channel_name:[0,3,1,""],is_connected:[0,3,1,""],receive:[0,3,1,""],register_callback:[0,3,1,""],register_connect_callback:[0,3,1,""],register_disconnect_callback:[0,3,1,""],send:[0,3,1,""]},"helpers.direct_socket_client":{connect:[0,3,1,""],reconnect:[0,3,1,""]},"helpers.ringbuffer":{append:[0,3,1,""],extend:[0,3,1,""]},helpers:{continues_statistic:[0,1,1,""],continues_statistic_multivalue:[0,1,1,""],direct_socket_base:[0,1,1,""],direct_socket_client:[0,1,1,""],direct_socket_server:[0,1,1,""],ringbuffer:[0,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","attribute","Python attribute"],"3":["py","method","Python method"]},objtypes:{"0":"py:module","1":"py:class","2":"py:attribute","3":"py:method"},terms:{"byte":0,"class":0,"float":0,"function":0,"import":0,"int":0,"new":0,"return":0,"true":0,The:0,Will:0,With:0,abc:0,abl:0,add:0,adding:0,after:0,alder:0,all:0,all_oth:0,also:0,append:0,arg:0,argument:0,author:0,avail:0,base:0,been:0,between:0,bool:0,buffer:0,call:0,callback:0,can:0,chang:0,channel:0,channel_nam:0,clean:0,client:0,commun:0,connect:0,continu:0,continues_statist:0,continues_statistic_multipl:0,continues_statistic_multivalu:0,creat:0,csm:0,current:0,data:0,debug:0,def:0,delet:0,descript:0,dict:0,direct:0,direct_socket_bas:0,direct_socket_cli:0,direct_socket_serv:0,dirk:0,disconnect:0,don:0,each:0,element:0,empti:0,end:0,entri:0,equival:0,establish:0,exampl:0,example_cli:0,example_serv:0,execut:0,exist:0,extend:0,fals:0,first:0,follow:0,from:0,get:0,given:0,had:0,have:0,identifi:0,includ:0,incom:0,index:0,info:0,init_channel_nam:0,initi:0,initialis:0,instanc:0,is_connect:0,iter:0,kei:0,keword:0,kwarg:0,least:0,length:0,level:0,limit:0,list:0,log:0,log_lvl:0,log_name_lvl:0,lost:0,mathemat:0,max:0,max_len:0,max_val:0,maximum:0,mean:0,method:0,min:0,min_val:0,mirror_callback:0,mockeri:0,modul:0,mount:0,multipl:0,name:0,need:0,none:0,nonetyp:0,num:0,number:0,numer:0,obj:0,object:0,one:0,oper:0,other:0,otherwis:0,out:0,outgo:0,output:0,over:0,own:0,page:0,paramet:0,parent:0,pass:0,path:0,pop:0,prefiou:0,print:0,quantifi:0,receiv:0,reconnect:0,reduc:0,register_callback:0,register_connect_callback:0,register_disconnect_callback:0,remot:0,remote_socket:0,report:0,repr:0,result:0,ringbuff:0,root:0,search:0,see:0,send:0,sent:0,server:0,singl:0,sock:0,socket:0,start:0,statist:0,statu:0,stdoutloggingconfigur:0,store:0,str:0,stream:0,submodul:0,sudo:0,support:0,sys:0,thi:0,time:0,timeout:0,type:0,unittest:0,use:0,used:0,val:0,valu:0,via:0,virtual_rate_bp:0,wai:0,wait:0,when:0,which:0,without:0,yet:0,you:0},titles:["Welcome to helpers\u2019s documentation!"],titleterms:{document:0,helper:0,indic:0,tabl:0,welcom:0}})

+ 11
- 0
_examples_/Makefile 查看文件

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

+ 10
- 0
_examples_/continues_statistic.py 查看文件

@@ -0,0 +1,10 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import helpers
5
+
6
+
7
+cs = helpers.continues_statistic()
8
+for val in (1, 3, 5, 4):
9
+    cs += helpers.continues_statistic(val)
10
+    print(cs)

+ 19
- 0
_examples_/continues_statistic_multivalue.py 查看文件

@@ -0,0 +1,19 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import helpers
5
+
6
+
7
+csm = helpers.continues_statistic_multivalue()
8
+print(csm, '\n--------------------------------------------------------------')
9
+csm += helpers.continues_statistic_multivalue(a={'mean': 3.1, 'min_val': 1, 'max_val': 3.5, 'quantifier': 305})
10
+print(csm, '\n--------------------------------------------------------------')
11
+csm += helpers.continues_statistic_multivalue(a=4.31, b={'mean': 17.1, 'min_val': 13.1, 'max_val': 19.3, 'quantifier': 27})
12
+print(csm, '\n--------------------------------------------------------------')
13
+print(helpers.continues_statistic_multivalue(dict(csm)), '\n--------------------------------------------------------------')
14
+print('pop out b:', csm.pop('b'), '\n--------------------------------------------------------------')
15
+print('pop out b:', csm.pop('b'), '\n--------------------------------------------------------------')
16
+print(csm, '\n--------------------------------------------------------------')
17
+print('pop out all:\n%s' % csm.pop(), '\n--------------------------------------------------------------')
18
+print('pop out all:\n%s' % csm.pop(), '\n--------------------------------------------------------------')
19
+print(csm, '\n--------------------------------------------------------------')

+ 21
- 0
_examples_/direct_socket.py 查看文件

@@ -0,0 +1,21 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import report
5
+import helpers
6
+import time
7
+
8
+
9
+def mirror_callback(sock):
10
+    sock.send(sock.receive())
11
+
12
+
13
+report.stdoutLoggingConfigure(log_name_lvl=[('root', 'DEBUG'), ])
14
+s = helpers.direct_socket_server(virtual_rate_bps=5)
15
+s.init_channel_name('example_server')
16
+s.register_callback(mirror_callback)
17
+c = helpers.direct_socket_client(max_len=2, virtual_rate_bps=5)
18
+c.init_channel_name('example_client')
19
+c.connect(s)
20
+c.send(b'abc')
21
+print('The Client received: %s' % repr(c.receive()))

+ 14
- 0
_examples_/ringbuffer.py 查看文件

@@ -0,0 +1,14 @@
1
+import sys
2
+sys.path.append('../..')
3
+
4
+import helpers
5
+
6
+
7
+rb = helpers.ringbuffer(length=5)
8
+print(rb, '\n--------------------------------------------------------------')
9
+rb.append(0)
10
+print(rb, '\n--------------------------------------------------------------')
11
+rb.extend((1,2,3,4,5,6))
12
+print(rb, '\n--------------------------------------------------------------')
13
+rb.append(17)
14
+print(rb, '\n--------------------------------------------------------------')

+ 0
- 0
_testresults_/unittest.pdf 查看文件


Loading…
取消
儲存