2020
2121**Software and Dependencies:**
2222
23- * Adafruit CircuitPython firmware `>= 7.0.0 for the supported boards.
24- <https://github.com/adafruit/circuitpython/releases>`_
25- * Core Module `usb_cdc:
23+ * Adafruit CircuitPython firmware
24+ `>= 7.0.0 for the supported boards. <https://github.com/adafruit/circuitpython/releases>`_
25+ * Core Module ` `` usb_cdc``
2626 <https://circuitpython.readthedocs.io/en/latest/shared-bindings/usb_cdc/index.html>`_
27+ * `CircuitPython_ansi_escape_code <https://github.com/s-light/CircuitPython_ansi_escape_code>`_
2728"""
2829
2930import time
4243
4344
4445class NonBlockingSerialInput :
45- """Non Blocking Serial Input Class.
46+ r """Non Blocking Serial Input Class.
4647
4748 This CircuitPython helper class can be used as non-blocking *drop-in* for the build
4849 in ``input()`` method.
@@ -54,7 +55,7 @@ class NonBlockingSerialInput:
5455 :param function input_handling_fn: function to call if there is one ore more
5556 fully received new lines. ``input_handling(input_string: string)``
5657 Default: None
57- :param function print_help_fn:function to call when a help text should be printed
58+ :param function print_help_fn: function to call when a help text should be printed
5859 fully received new lines. ``print_help()``
5960 Default: None
6061 :param ~usb_cdc.Serial serial: serial connection object to use
@@ -76,10 +77,10 @@ class NonBlockingSerialInput:
7677 :param string, list line_end_custom: set custom line ends
7778 Default: None
7879 :param bool use_universal_line_end_basic: use a basic default set of line_ends
79- [` \n ` , '\r ', '\r \n ']
80+ ``['\n' , '\r', '\r\n']`` ]
8081 Default: True
8182 :param bool use_universal_line_end_advanced: use a advanced default set of line_ends
82- ['\v ', '\f ', '\x1c ',...]
83+ `` ['\v', '\f', '\x1c',...]``
8384 Default: False
8485 :param bool verbose: print debugging information in some internal functions. Default to False
8586
@@ -168,7 +169,7 @@ def echo_print(self):
168169
169170 def print (self , * args , content = True ):
170171 # def print(self, *args, end="\n"):
171- """
172+ r """
172173 Print information & variables to the connected serial.
173174
174175 This is a *drop in replacement* for the global print function.
@@ -177,7 +178,7 @@ def print(self, *args, content=True):
177178
178179 currently it is not supported to print without newline at end.
179180
180- :param object *args: things to print
181+ :param object \ *args: things to print
181182 """
182183 # :param bool end: line end character to print. Default: "\n"
183184 if self .echo or self .statusline :
@@ -280,11 +281,12 @@ def _buffer_handle_cursor_position(self):
280281
281282 def input (self ):
282283 """
283- Input .
284+ Get oldest input if available .
284285
285- get oldest input string if there is any available. Otherwise an emtpy string.
286+ test
287+ Otherwise an emtpy string.
286288
287- :return string: if available oldest input_line. Otherwise `"" `
289+ :return string: if available oldest input_line. otherwise ``""` `
288290 """
289291 try :
290292 result = self .input_list .pop (0 )
@@ -395,7 +397,7 @@ def find_first_line_end(input_string, line_end_list=None, start=0):
395397 :param string input_string: input search
396398 :param list line_end_list: list with strings to search for.
397399 :param int start: start position for search. (default = 0)
398- :return int: index of first found line_end; `-1 ` if nothing is found.
400+ :return int: index of first found line_end; ``-1` ` if nothing is found.
399401 """
400402 result = None
401403 if line_end_list is None :
@@ -422,7 +424,7 @@ def splitlines_advanced(input_string, line_end_list=None):
422424 then splits at these points. the resulting list is returned.
423425 this also returns empty string segments.
424426 the search happens in the order of line_end_list.
425- if the string does not end with a line_end symbol this last part will be returned in `rest`
427+ if the string does not end with a line_end symbol this last part will be returned in `` rest` `
426428
427429 :param string input_string: input to split
428430 :param list line_end_list: list with strings where the splitting should happen.
@@ -471,11 +473,12 @@ def parse_value(input_string, pre_text=""):
471473 """
472474 Parse Value from input_string.
473475
474- known values are numbers (`float()` is used), None, True, False
476+ known values are numbers (`` float()`` is used), `` None``, `` True``, `` False``
475477
476478 :param string input_string: input to parse
477- :param string pre_text: text at start of input_string to ignore. defaults to ""
478- :return float | None | True | False: parsed value
479+ :param string pre_text: text at start of input_string to ignore. defaults to ``""``
480+ :return: parsed value
481+ :rtype: float, None, bool
479482 """
480483 value = None
481484 # strip pre_text
0 commit comments