mpflash 0.7.1__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {mpflash-0.7.1 → mpflash-0.7.2}/PKG-INFO +3 -3
  2. {mpflash-0.7.1 → mpflash-0.7.2}/README.md +2 -2
  3. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpboard_id/board_id.py +14 -11
  4. {mpflash-0.7.1 → mpflash-0.7.2}/pyproject.toml +1 -1
  5. {mpflash-0.7.1 → mpflash-0.7.2}/LICENSE +0 -0
  6. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/__init__.py +0 -0
  7. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/ask_input.py +0 -0
  8. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/cli_download.py +0 -0
  9. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/cli_flash.py +0 -0
  10. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/cli_group.py +0 -0
  11. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/cli_list.py +0 -0
  12. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/cli_main.py +0 -0
  13. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/common.py +0 -0
  14. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/config.py +0 -0
  15. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/download.py +0 -0
  16. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/downloaded.py +0 -0
  17. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/errors.py +0 -0
  18. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash.py +0 -0
  19. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_esp.py +0 -0
  20. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_stm32.py +0 -0
  21. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_stm32_cube.py +0 -0
  22. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_stm32_dfu.py +0 -0
  23. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_uf2.py +0 -0
  24. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_uf2_boardid.py +0 -0
  25. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_uf2_linux.py +0 -0
  26. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/flash_uf2_windows.py +0 -0
  27. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/list.py +0 -0
  28. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/logger.py +0 -0
  29. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpboard_id/__init__.py +0 -0
  30. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpboard_id/board_info.csv +0 -0
  31. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpboard_id/board_info.json +0 -0
  32. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpremoteboard/__init__.py +0 -0
  33. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpremoteboard/mpy_fw_info.py +0 -0
  34. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/mpremoteboard/runner.py +0 -0
  35. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/vendor/dfu.py +0 -0
  36. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/vendor/pydfu.py +0 -0
  37. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/vendor/readme.md +0 -0
  38. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/vendor/versions.py +0 -0
  39. {mpflash-0.7.1 → mpflash-0.7.2}/mpflash/worklist.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mpflash
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Flash and download tool for MicroPython firmwares
5
5
  Home-page: https://github.com/Josverl/micropython-stubber/blob/main/src/mpflash/README.md
6
6
  License: MIT
@@ -204,8 +204,8 @@ Note that if no matching firmware can be found for a board, it will be skipped.
204
204
  (For example, the PYBV11 and ESP32_GENERIC_S3 boards in the example above.)
205
205
 
206
206
  ## Issues and bug reports
207
- mpflash is currently co-located in the [micropython-stubber](https://github.com/Josverl/micropython-stubber) repository.
208
- Please report any issues or bugs in the [issue tracker](https://github.com/Josverl/micropython-stubber/issues) with '[mpflash]' in the subject.
207
+ mpflash is currently co-located in the [micropython-stubber](https://github.com/Josverl/micropython-stubber) repository.
208
+ Please report any issues or bugs in the [issue tracker](https://github.com/Josverl/micropython-stubber/issues) using the MPflash feedback template.
209
209
 
210
210
  ## License
211
211
  mpflash is licensed under the MIT license. See the LICENSE file for more details.
@@ -166,8 +166,8 @@ Note that if no matching firmware can be found for a board, it will be skipped.
166
166
  (For example, the PYBV11 and ESP32_GENERIC_S3 boards in the example above.)
167
167
 
168
168
  ## Issues and bug reports
169
- mpflash is currently co-located in the [micropython-stubber](https://github.com/Josverl/micropython-stubber) repository.
170
- Please report any issues or bugs in the [issue tracker](https://github.com/Josverl/micropython-stubber/issues) with '[mpflash]' in the subject.
169
+ mpflash is currently co-located in the [micropython-stubber](https://github.com/Josverl/micropython-stubber) repository.
170
+ Please report any issues or bugs in the [issue tracker](https://github.com/Josverl/micropython-stubber/issues) using the MPflash feedback template.
171
171
 
172
172
  ## License
173
173
  mpflash is licensed under the MIT license. See the LICENSE file for more details.
@@ -18,20 +18,23 @@ HERE = Path(__file__).parent
18
18
  def find_board_id(
19
19
  descr: str, short_descr: str, board_info: Optional[Path] = None, version: str = "stable"
20
20
  ) -> Optional[str]:
21
- # TODO: use the json file instead of the csv and get the cpu
22
- boards = find_board_by_description(
23
- descr=descr,
24
- short_descr=short_descr,
25
- board_info=board_info,
26
- version=clean_version(version),
27
- )
28
- return boards[-1]["board"]
21
+ """Find the MicroPython BOARD_ID based on the description in the firmware"""
22
+ try:
23
+ boards = find_board_id_by_description(
24
+ descr=descr,
25
+ short_descr=short_descr,
26
+ board_info=board_info,
27
+ version=clean_version(version),
28
+ )
29
+ return boards[-1]["board"]
30
+ except MPFlashError:
31
+ return "UNKNOWN_BOARD"
29
32
 
30
33
 
31
34
  @functools.lru_cache(maxsize=20)
32
- def find_board_by_description(*, descr: str, short_descr: str, version="v1.21.0", board_info: Optional[Path] = None):
35
+ def find_board_id_by_description(*, descr: str, short_descr: str, version="v1.21.0", board_info: Optional[Path] = None):
33
36
  """
34
- Find the MicroPython BOARD designator based on the description in the firmware
37
+ Find the MicroPython BOARD_ID based on the description in the firmware
35
38
  using the pre-built board_info.json file
36
39
  """
37
40
  if not board_info:
@@ -52,7 +55,7 @@ def find_board_by_description(*, descr: str, short_descr: str, version="v1.21.0"
52
55
  if not matches and short_descr:
53
56
  matches = [b for b in version_matches if b["description"] == short_descr]
54
57
  if not matches:
55
- raise MPFlashError(f"No board info found for description {descr}")
58
+ raise MPFlashError(f"No board info found for description '{descr}' or '{short_descr}'")
56
59
  return sorted(matches, key=lambda x: x["version"])
57
60
 
58
61
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "mpflash"
3
- version = "0.7.1"
3
+ version = "0.7.2"
4
4
  description = "Flash and download tool for MicroPython firmwares"
5
5
  authors = ["Jos Verlinde <jos_verlinde@hotmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes