From b3125247bfd0fa4d03662c49eb416aa3397a36de Mon Sep 17 00:00:00 2001 From: Marcel Petrick Date: Mon, 17 Nov 2025 13:25:15 +0100 Subject: [PATCH] all: Correct various typos in comments and docs. Non-functional changes only: - Fixed minor spelling mistakes in comments. - Corrected typos in user-facing strings. - No variables, logic, or functional code was modified. Signed-off-by: Marcel Petrick --- micropython/aiorepl/aiorepl.py | 2 +- .../bluetooth/aioble/examples/l2cap_file_server.py | 2 +- micropython/drivers/display/lcd160cr/lcd160cr.py | 2 +- micropython/drivers/imu/bmi270/bmi270.py | 2 +- micropython/drivers/imu/bmm150/bmm150.py | 2 +- micropython/drivers/imu/lsm6dsox/lsm6dsox.py | 2 +- micropython/drivers/imu/lsm9ds1/lsm9ds1.py | 6 +++--- micropython/lora/lora-sx126x/lora/sx126x.py | 2 +- micropython/lora/lora/lora/modem.py | 2 +- micropython/senml/docs/index.md | 2 +- micropython/senml/docs/senml_record.md | 4 ++-- micropython/senml/examples/custom_record.py | 2 +- micropython/senml/senml/senml_pack.py | 2 +- micropython/senml/senml/senml_record.py | 6 +++--- micropython/ucontextlib/ucontextlib.py | 2 +- micropython/umqtt.simple/README.rst | 2 +- micropython/usb/usb-device-cdc/usb/device/cdc.py | 2 +- micropython/usb/usb-device-midi/usb/device/midi.py | 2 +- .../usb/usb-device-mouse/usb/device/mouse.py | 2 +- micropython/usb/usb-device/usb/device/core.py | 2 +- python-stdlib/datetime/test_datetime.py | 4 ++-- python-stdlib/pathlib/tests/test_pathlib.py | 2 +- python-stdlib/time/README.md | 2 +- python-stdlib/unittest/examples/example_subtest.py | 4 ++-- tools/uncrustify.cfg | 14 +++++++------- unix-ffi/cgi/cgi.py | 2 +- unix-ffi/ucurses/ucurses/__init__.py | 2 +- 27 files changed, 40 insertions(+), 40 deletions(-) diff --git a/micropython/aiorepl/aiorepl.py b/micropython/aiorepl/aiorepl.py index fbe513b7c..15026e435 100644 --- a/micropython/aiorepl/aiorepl.py +++ b/micropython/aiorepl/aiorepl.py @@ -74,7 +74,7 @@ async def kbd_intr_task(exec_task, s): except asyncio.CancelledError: pass else: - # Excute code snippet directly. + # Execute code snippet directly. try: try: micropython.kbd_intr(3) diff --git a/micropython/bluetooth/aioble/examples/l2cap_file_server.py b/micropython/bluetooth/aioble/examples/l2cap_file_server.py index 3c3b3b44d..95aad0b38 100644 --- a/micropython/bluetooth/aioble/examples/l2cap_file_server.py +++ b/micropython/bluetooth/aioble/examples/l2cap_file_server.py @@ -1,7 +1,7 @@ # MIT license; Copyright (c) 2021 Jim Mussared # This is a BLE file server, based very loosely on the Object Transfer Service -# specification. It demonstrated transfering data over an L2CAP channel, as +# specification. It demonstrated transferring data over an L2CAP channel, as # well as using notifications and GATT writes on a characteristic. # The server supports downloading and uploading files, as well as querying diff --git a/micropython/drivers/display/lcd160cr/lcd160cr.py b/micropython/drivers/display/lcd160cr/lcd160cr.py index 177c6fea3..1d5da2293 100644 --- a/micropython/drivers/display/lcd160cr/lcd160cr.py +++ b/micropython/drivers/display/lcd160cr/lcd160cr.py @@ -56,7 +56,7 @@ def __init__(self, connect=None, *, pwr=None, i2c=None, spi=None, i2c_addr=98): pwr(1) sleep_ms(10) # else: - # alread have power + # already have power # lets be optimistic... # set connections diff --git a/micropython/drivers/imu/bmi270/bmi270.py b/micropython/drivers/imu/bmi270/bmi270.py index c76962f7e..1e4a940c3 100644 --- a/micropython/drivers/imu/bmi270/bmi270.py +++ b/micropython/drivers/imu/bmi270/bmi270.py @@ -504,7 +504,7 @@ def __init__( accel_scale=4, bmm_magnet=None, ): - """Initalizes Gyro and Accelerometer. + """Initializes Gyro and Accelerometer. bus: IMU bus address: I2C address (in I2C mode). cs: SPI CS pin (in SPI mode). diff --git a/micropython/drivers/imu/bmm150/bmm150.py b/micropython/drivers/imu/bmm150/bmm150.py index aea4348b5..a56c6fe78 100644 --- a/micropython/drivers/imu/bmm150/bmm150.py +++ b/micropython/drivers/imu/bmm150/bmm150.py @@ -66,7 +66,7 @@ def __init__( address=_DEFAULT_ADDR, magnet_odr=30, ): - """Initalizes the Magnetometer. + """Initializes the Magnetometer. bus: IMU bus address: I2C address (in I2C mode). cs: SPI CS pin (in SPI mode). diff --git a/micropython/drivers/imu/lsm6dsox/lsm6dsox.py b/micropython/drivers/imu/lsm6dsox/lsm6dsox.py index b932ff006..ca7b77673 100644 --- a/micropython/drivers/imu/lsm6dsox/lsm6dsox.py +++ b/micropython/drivers/imu/lsm6dsox/lsm6dsox.py @@ -89,7 +89,7 @@ def __init__( accel_scale=4, ucf=None, ): - """Initalizes Gyro and Accelerator. + """Initializes Gyro and Accelerator. accel_odr: (0, 1.6Hz, 3.33Hz, 6.66Hz, 12.5Hz, 26Hz, 52Hz, 104Hz, 208Hz, 416Hz, 888Hz) gyro_odr: (0, 1.6Hz, 3.33Hz, 6.66Hz, 12.5Hz, 26Hz, 52Hz, 104Hz, 208Hz, 416Hz, 888Hz) gyro_scale: (245dps, 500dps, 1000dps, 2000dps) diff --git a/micropython/drivers/imu/lsm9ds1/lsm9ds1.py b/micropython/drivers/imu/lsm9ds1/lsm9ds1.py index a45e73039..5f1bfb6cc 100644 --- a/micropython/drivers/imu/lsm9ds1/lsm9ds1.py +++ b/micropython/drivers/imu/lsm9ds1/lsm9ds1.py @@ -81,7 +81,7 @@ def __init__( magnet_odr=80, magnet_scale=4, ): - """Initalizes Gyro, Accelerometer and Magnetometer. + """Initializes Gyro, Accelerometer and Magnetometer. bus: IMU bus address_imu: IMU I2C address. address_magnet: Magnetometer I2C address. @@ -134,14 +134,14 @@ def __init__( mv[5] = 0x2 # ctrl9 - FIFO enabled self.bus.writeto_mem(self.address_imu, _CTRL_REG4_G, mv) - # fifo: use continous mode (overwrite old data if overflow) + # fifo: use continuous mode (overwrite old data if overflow) self.bus.writeto_mem(self.address_imu, _FIFO_CTRL_REG, b"\x00") self.bus.writeto_mem(self.address_imu, _FIFO_CTRL_REG, b"\xc0") # Configure Magnetometer mv[0] = 0x40 | (magnet_odr << 2) # ctrl1: high performance mode mv[1] = _MAGNET_SCALE.index(magnet_scale) << 5 # ctrl2: scale, normal mode, no reset - mv[2] = 0x00 # ctrl3: continous conversion, no low power, I2C + mv[2] = 0x00 # ctrl3: continuous conversion, no low power, I2C mv[3] = 0x08 # ctrl4: high performance z-axis mv[4] = 0x00 # ctr5: no fast read, no block update self.bus.writeto_mem(self.address_magnet, _CTRL_REG1_M, mv[:5]) diff --git a/micropython/lora/lora-sx126x/lora/sx126x.py b/micropython/lora/lora-sx126x/lora/sx126x.py index 7fa4896ae..446489431 100644 --- a/micropython/lora/lora-sx126x/lora/sx126x.py +++ b/micropython/lora/lora-sx126x/lora/sx126x.py @@ -501,7 +501,7 @@ def calibrate_image(self): self._cmd(">BH", _CMD_CALIBRATE_IMAGE, args) - # Can't find anythign in Datasheet about how long image calibration + # Can't find anything in Datasheet about how long image calibration # takes or exactly how it signals completion. Assuming it will be # similar to _CMD_CALIBRATE. self._wait_not_busy(_CALIBRATE_TIMEOUT_US) diff --git a/micropython/lora/lora/lora/modem.py b/micropython/lora/lora/lora/modem.py index 499712acf..73fd4db20 100644 --- a/micropython/lora/lora/lora/modem.py +++ b/micropython/lora/lora/lora/modem.py @@ -47,7 +47,7 @@ def __init__(self, ant_sw): self._bw_hz = 125000 # Reset value self._coding_rate = 5 self._crc_en = True # use packet CRCs - self._implicit_header = False # implict vs explicit header mode + self._implicit_header = False # implicit vs explicit header mode self._preamble_len = 12 self._coding_rate = 5 diff --git a/micropython/senml/docs/index.md b/micropython/senml/docs/index.md index 91ed7fe99..e849f2ca7 100644 --- a/micropython/senml/docs/index.md +++ b/micropython/senml/docs/index.md @@ -1,4 +1,4 @@ -Welcome to the API documet site for the micro-python SenML library. +Welcome to the API document site for the micro-python SenML library. The following api sections are available: diff --git a/micropython/senml/docs/senml_record.md b/micropython/senml/docs/senml_record.md index 6bac549a5..e7c8d0cd0 100644 --- a/micropython/senml/docs/senml_record.md +++ b/micropython/senml/docs/senml_record.md @@ -42,11 +42,11 @@ _parameters:_ - `kwargs:` optional parameters: - value: the value to store in the record - time: the timestamp to use (when was the value measured) - - name: the name of hte record + - name: the name of the record - unit: unit value - sum: sum value - update_time: max time before sensor will provide an updated reading - - callback: a callback function taht will be called when actuator data has been found. Expects no params + - callback: a callback function that will be called when actuator data has been found. Expects no params ### do_actuate diff --git a/micropython/senml/examples/custom_record.py b/micropython/senml/examples/custom_record.py index 1e83ea06b..ece866791 100644 --- a/micropython/senml/examples/custom_record.py +++ b/micropython/senml/examples/custom_record.py @@ -33,7 +33,7 @@ def __init__(self, name, **kwargs): """overriding the init function so we can initiate the 3 senml records that will represent lat,lon, alt""" self._lat = SenmlRecord( "lattitude", unit=SenmlUnits.SENML_UNIT_DEGREES_LATITUDE - ) # create these befor calling base constructor so that all can be init correctly from constructor + ) # create these before calling base constructor so that all can be init correctly from constructor self._lon = SenmlRecord("longitude", unit=SenmlUnits.SENML_UNIT_DEGREES_LONGITUDE) self._alt = SenmlRecord("altitude", unit=SenmlUnits.SENML_UNIT_METER) super(Coordinates, self).__init__( diff --git a/micropython/senml/senml/senml_pack.py b/micropython/senml/senml/senml_pack.py index 5a0554467..cb5f89fa5 100644 --- a/micropython/senml/senml/senml_pack.py +++ b/micropython/senml/senml/senml_pack.py @@ -169,7 +169,7 @@ def from_json(self, data): def _process_incomming_data(self, records, naming_map): """ - generic processor for incomming data (actuators. + generic processor for incoming data (actuators. :param records: the list of raw senml data, parsed from a json or cbor structure :param naming_map: translates cbor to json field names (when needed). :return: None diff --git a/micropython/senml/senml/senml_record.py b/micropython/senml/senml/senml_record.py index ae40f0f70..9cc260f5b 100644 --- a/micropython/senml/senml/senml_record.py +++ b/micropython/senml/senml/senml_record.py @@ -36,11 +36,11 @@ def __init__(self, name, **kwargs): :param kwargs: optional parameters: - value: the value to store in the record - time: the timestamp to use (when was the value measured) - - name: the name of hte record + - name: the name of the record - unit: unit value - sum: sum value - update_time: max time before sensor will provide an updated reading - - callback: a callback function taht will be called when actuator data has been found. Expects no params + - callback: a callback function that will be called when actuator data has been found. Expects no params """ self.__parent = None # using double __ cause it's a field for an internal property self._unit = None # declare and init internal fields @@ -106,7 +106,7 @@ def value(self): @value.setter def value(self, value): - """set the current value. Will not automatically update the time stamp. This has to be done seperatly for more + """set the current value. Will not automatically update the time stamp. This has to be done separately for more finegrained control Note: when the value is a float, you can control rounding in the rendered output by using the function round() while assigning the value. ex: record.value = round(12.2 / 1.5423, 2) diff --git a/micropython/ucontextlib/ucontextlib.py b/micropython/ucontextlib/ucontextlib.py index d259f9b8f..d7d984a95 100644 --- a/micropython/ucontextlib/ucontextlib.py +++ b/micropython/ucontextlib/ucontextlib.py @@ -6,7 +6,7 @@ - redirect_stdout; - ExitStack. - closing - - supress + - suppress """ diff --git a/micropython/umqtt.simple/README.rst b/micropython/umqtt.simple/README.rst index d9d09b970..ee360ad61 100644 --- a/micropython/umqtt.simple/README.rst +++ b/micropython/umqtt.simple/README.rst @@ -47,7 +47,7 @@ Taking into account API traits described above, umqtt pretty closely follows MQTT control operations, and maps them to class methods: * ``connect(...)`` - Connect to a server. Returns True if this connection - uses persisten session stored on a server (this will be always False if + uses persistent session stored on a server (this will be always False if clean_session=True argument is used (default)). * ``disconnect()`` - Disconnect from a server, release resources. * ``ping()`` - Ping server (response is processed automatically by wait_msg()). diff --git a/micropython/usb/usb-device-cdc/usb/device/cdc.py b/micropython/usb/usb-device-cdc/usb/device/cdc.py index 0acea184f..4ec012bc5 100644 --- a/micropython/usb/usb-device-cdc/usb/device/cdc.py +++ b/micropython/usb/usb-device-cdc/usb/device/cdc.py @@ -228,7 +228,7 @@ def desc_cfg(self, desc, itf_num, ep_num, strs): 5, # bFunctionLength _CS_DESC_TYPE, # bDescriptorType _CDC_FUNC_DESC_CALL_MANAGEMENT, # bDescriptorSubtype - 0, # bmCapabilities - XXX no call managment so far + 0, # bmCapabilities - XXX no call management so far itf_num + 1, # bDataInterface - interface 1 ) diff --git a/micropython/usb/usb-device-midi/usb/device/midi.py b/micropython/usb/usb-device-midi/usb/device/midi.py index ecb178ea4..55bfbd08b 100644 --- a/micropython/usb/usb-device-midi/usb/device/midi.py +++ b/micropython/usb/usb-device-midi/usb/device/midi.py @@ -61,7 +61,7 @@ class MIDIInterface(Interface): # Base class to implement a USB MIDI device in Python. # - # To be compliant this also regisers a dummy USB Audio interface, but that + # To be compliant this also registers a dummy USB Audio interface, but that # interface isn't otherwise used. def __init__(self, rxlen=16, txlen=16): diff --git a/micropython/usb/usb-device-mouse/usb/device/mouse.py b/micropython/usb/usb-device-mouse/usb/device/mouse.py index d3dea9c61..61345276b 100644 --- a/micropython/usb/usb-device-mouse/usb/device/mouse.py +++ b/micropython/usb/usb-device-mouse/usb/device/mouse.py @@ -77,7 +77,7 @@ def move_by(self, dx, dy): b'\xA1\x00' # Collection (Physical) b'\x05\x09' # Usage Page (Buttons) b'\x19\x01' # Usage Minimum (01), - b'\x29\x03' # Usage Maximun (03), + b'\x29\x03' # Usage Maximum (03), b'\x15\x00' # Logical Minimum (0), b'\x25\x01' # Logical Maximum (1), b'\x95\x03' # Report Count (3), diff --git a/micropython/usb/usb-device/usb/device/core.py b/micropython/usb/usb-device/usb/device/core.py index b0d91d8ff..926c662bd 100644 --- a/micropython/usb/usb-device/usb/device/core.py +++ b/micropython/usb/usb-device/usb/device/core.py @@ -446,7 +446,7 @@ def num_itfs(self): # Return the number of actual USB Interfaces represented by this object # (as set in desc_cfg().) # - # Only needs to be overriden if implementing a Interface class that + # Only needs to be overridden if implementing a Interface class that # represents more than one USB Interface descriptor (i.e. MIDI), or an # Interface Association Descriptor (i.e. USB-CDC). return 1 diff --git a/python-stdlib/datetime/test_datetime.py b/python-stdlib/datetime/test_datetime.py index 56411b96e..999bfaca9 100644 --- a/python-stdlib/datetime/test_datetime.py +++ b/python-stdlib/datetime/test_datetime.py @@ -2091,7 +2091,7 @@ def test_timestamp01(self): def test_timestamp02(self): with LocalTz("Europe/Rome"): - dt = datetime(2010, 3, 28, 2, 30) # doens't exist + dt = datetime(2010, 3, 28, 2, 30) # doesn't exist self.assertEqual(dt.timestamp(), 1269739800.0) def test_timestamp03(self): @@ -2111,7 +2111,7 @@ def test_timestamp05(self): def test_timestamp06(self): with LocalTz("US/Eastern"): - dt = datetime(2020, 3, 8, 2, 30) # doens't exist + dt = datetime(2020, 3, 8, 2, 30) # doesn't exist self.assertEqual(dt.timestamp(), 1583652600.0) def test_timestamp07(self): diff --git a/python-stdlib/pathlib/tests/test_pathlib.py b/python-stdlib/pathlib/tests/test_pathlib.py index e632e1242..31e762eea 100644 --- a/python-stdlib/pathlib/tests/test_pathlib.py +++ b/python-stdlib/pathlib/tests/test_pathlib.py @@ -234,7 +234,7 @@ def test_touch(self): self.assertExists(target) # Technically should be FileExistsError, - # but thats not builtin to micropython + # but that's not builtin to micropython with self.assertRaises(OSError): path.touch(exist_ok=False) diff --git a/python-stdlib/time/README.md b/python-stdlib/time/README.md index f07517305..f3d880ad7 100644 --- a/python-stdlib/time/README.md +++ b/python-stdlib/time/README.md @@ -19,7 +19,7 @@ See [Package management](https://docs.micropython.org/en/latest/reference/packag ## Common uses -`strftime()` is used when using a loggging [Formatter +`strftime()` is used when using a logging [Formatter Object](https://docs.python.org/3/library/logging.html#formatter-objects) that employs [`asctime`](https://docs.python.org/3/library/logging.html#formatter-objects). diff --git a/python-stdlib/unittest/examples/example_subtest.py b/python-stdlib/unittest/examples/example_subtest.py index 558af0b26..40b87d45b 100644 --- a/python-stdlib/unittest/examples/example_subtest.py +++ b/python-stdlib/unittest/examples/example_subtest.py @@ -99,7 +99,7 @@ def test_sorted(self) -> None: self.assertEqual(sorted(test["unsorted"]), test["sorted"]) def test_factorial(self) -> None: - """Test that the factorial fuction correctly calculates factorials + """Test that the factorial function correctly calculates factorials Makes use of `msg` argument in subtest method to clarify which subtests had an error in the results @@ -190,7 +190,7 @@ def test_person(self) -> None: self.assertFalse(bob.has_friend(alice)) # Friendship is not always commutative, so Bob is not implicitly friends with Alice - with self.subTest("Alice and Bob should not both be friends with eachother"): + with self.subTest("Alice and Bob should not both be friends with each other"): with self.assertRaises(AssertionError): self.assertTrue(bob.has_friend(alice) and alice.has_friend(bob)) diff --git a/tools/uncrustify.cfg b/tools/uncrustify.cfg index 80542b903..7a0ff0d46 100644 --- a/tools/uncrustify.cfg +++ b/tools/uncrustify.cfg @@ -1323,7 +1323,7 @@ indent_using_block = true # true/false # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number -# Whether to indent the statments inside ternary operator. +# Whether to indent the statements inside ternary operator. indent_inside_ternary_operator = false # true/false # If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. @@ -1779,7 +1779,7 @@ nl_func_call_args_multi_line = false # true/false # different lines. nl_func_call_end_multi_line = false # true/false -# Whether to respect nl_func_call_XXX option incase of closure args. +# Whether to respect nl_func_call_XXX option in case of closure args. nl_func_call_args_multi_line_ignore_closures = false # true/false # Whether to add a newline after '<' of a template parameter list. @@ -2570,7 +2570,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2916,28 +2916,28 @@ pp_define_at_level = false # true/false pp_ignore_define_body = false # true/false # Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements +# Only applies to the indent of the preprocessor that the case statements # directly inside of. # # Default: true pp_indent_case = true # true/false # Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition +# Only applies to the indent of the preprocessor that the function definition # is directly inside of. # # Default: true pp_indent_func_def = true # true/false # Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is +# Only applies to the indent of the preprocessor that the extern block is # directly inside of. # # Default: true pp_indent_extern = true # true/false # Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly +# Only applies to the indent of the preprocessor that the braces are directly # inside of. # # Default: true diff --git a/unix-ffi/cgi/cgi.py b/unix-ffi/cgi/cgi.py index 550f70713..e8e91bfe4 100644 --- a/unix-ffi/cgi/cgi.py +++ b/unix-ffi/cgi/cgi.py @@ -197,7 +197,7 @@ def parse(fp=None, environ=os.environ, keep_blank_values=0, strict_parsing=0): # parse query string function called from urlparse, -# this is done in order to maintain backward compatiblity. +# this is done in order to maintain backward compatibility. def parse_qs(qs, keep_blank_values=0, strict_parsing=0): diff --git a/unix-ffi/ucurses/ucurses/__init__.py b/unix-ffi/ucurses/ucurses/__init__.py index 688df745c..2e3af32d6 100644 --- a/unix-ffi/ucurses/ucurses/__init__.py +++ b/unix-ffi/ucurses/ucurses/__init__.py @@ -311,7 +311,7 @@ def meta(yes): def mousemask(mask): - # Mouse reporting - X10 compatbility mode + # Mouse reporting - X10 compatibility mode _wr(b"\x1b[?9h")