mpflash 0.7.1__py3-none-any.whl → 0.7.2__py3-none-any.whl

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.
@@ -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
  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.
@@ -22,7 +22,7 @@ mpflash/flash_uf2_windows.py,sha256=dcmA-koavH7duOuNwI0n2aDDbhF1_5ZZ-mXFAXgj8z4,
22
22
  mpflash/list.py,sha256=R3upYux3mEltpqfrt467Ufs4hVatW1NE40jjhN7Ei1g,3252
23
23
  mpflash/logger.py,sha256=dI_H_a7EOdQJyvoeRHQuYeZuTKYVUS3DUPTLhE9rkdM,1098
24
24
  mpflash/mpboard_id/__init__.py,sha256=JYGe7VwpBV4ig2M9a6vJUQrMtgdNjZKHt_Z5N13Ycrs,3509
25
- mpflash/mpboard_id/board_id.py,sha256=NjKkIUv3sw6X60qy--mieQWrle3WNKw5NwAepMenTHI,2230
25
+ mpflash/mpboard_id/board_id.py,sha256=G2oW969pqDuLbQS7UrFNmbWNdDIXfWBAoZMt1EWHLak,2361
26
26
  mpflash/mpboard_id/board_info.csv,sha256=KPWDo-zHWfrPGQn9oInsDH-5IdCzhBCs6K_YAmqqSpQ,96983
27
27
  mpflash/mpboard_id/board_info.json,sha256=JtVyOMIO1O7vLKzJ0hyXQ4JSxXiQBJyay2hjdNLnZM0,674442
28
28
  mpflash/mpremoteboard/__init__.py,sha256=DxlO_7LiyWDz5hNRI77fzp3sI3fZQ9Sd23dnGLx4Zl0,7017
@@ -33,8 +33,8 @@ mpflash/vendor/pydfu.py,sha256=_MdBRo1EeNeKDqFPSTB5tNL1jGSBJgsVeVjE5e7Pb8s,20542
33
33
  mpflash/vendor/readme.md,sha256=iIIZxuLUIGHQ0KODzYVtMezsztvyxCXcNJp_AzwTIPk,86
34
34
  mpflash/vendor/versions.py,sha256=ooRZjeeYepQHwp12hMu2m0p8nZXQ5s942w5mGkKmgeI,3629
35
35
  mpflash/worklist.py,sha256=qZsqF3Lf5Bl7QQ31ZLVHewP6WC8fmwQPMbyNgbG7LB4,5299
36
- mpflash-0.7.1.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
37
- mpflash-0.7.1.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
38
- mpflash-0.7.1.dist-info/METADATA,sha256=aAxXPamGn_mE__rBwjcZwSQlj-lQo8KA8HzyhmUIc9U,14627
39
- mpflash-0.7.1.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
40
- mpflash-0.7.1.dist-info/RECORD,,
36
+ mpflash-0.7.2.dist-info/entry_points.txt,sha256=Jk_visOhYOsZIcSP2Ms9hKqfKy1iorR-6dYltSoWCpY,52
37
+ mpflash-0.7.2.dist-info/LICENSE,sha256=mWpNhsIxWzetYNnTpr4eb3HtgsxGIC8KcYWxXEcxQvE,1077
38
+ mpflash-0.7.2.dist-info/METADATA,sha256=juE__4z2r7HjEg7awe3Yt423W95PSnyskM4MnJtCbOU,14633
39
+ mpflash-0.7.2.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
40
+ mpflash-0.7.2.dist-info/RECORD,,