Skip to content

Commit 9090ba0

Browse files
CopilotJosverl
andcommitted
fix: merge PR #54 logic into Peewee-based downloaded.py and known.py
Agent-Logs-Url: https://github.com/Josverl/mpflash/sessions/aa04d353-9662-4e16-af82-a6e9dd592f2d Co-authored-by: Josverl <981654+Josverl@users.noreply.github.com>
1 parent 165044b commit 9090ba0

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

mpflash/downloaded.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def find_downloaded_firmware(
103103
if fw_list:
104104
return [fw_list[0]]
105105
else:
106-
fw_list = list(Firmware.select().where((Firmware.board_id.in_(more_board_ids)) & (Firmware.version == version)))
106+
qry = Firmware.select().where((Firmware.board_id.in_(more_board_ids)) & (Firmware.version == version))
107107
if port:
108108
qry = qry.where(Firmware.port == port)
109109
fw_list = list(qry)

mpflash/mpboard_id/known.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def find_known_board(board_id: str, version="", port="") -> Board:
7373

7474
lookup_id = board_id.split("@")[0]
7575

76-
# Primary lookup by board_id
7776
qry = Board.select().where(Board.board_id == lookup_id)
7877
if version:
7978
qry = qry.where(Board.version == version)
@@ -84,7 +83,7 @@ def find_known_board(board_id: str, version="", port="") -> Board:
8483
matching = [b for b in candidates if b.port == port]
8584
if matching:
8685
return matching[0]
87-
# No port match among candidates - fall through to alternate name lookup
86+
# No port match among candidates fall through to alternate name lookup
8887
else:
8988
return candidates[0]
9089

0 commit comments

Comments
 (0)