Skip to content

Commit

Permalink
small code quality fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bwnance committed Nov 7, 2023
1 parent 679e766 commit 2adbeba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions klippy/klippy.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _build_protocol_error_message(self, e):
msg_update = []
msg_updated = []

for n, mcu_obj in self.lookup_objects("mcu"):
for mcu_name, mcu_obj in self.lookup_objects("mcu"):
try:
mcu_version = mcu_obj.get_status()["mcu_version"]
except:
Expand All @@ -220,15 +220,21 @@ def _build_protocol_error_message(self, e):
if mcu_version != host_version:
msg_update.append(
"%s: Current version %s"
% (n.split()[-1], mcu_obj.get_status()["mcu_version"])
% (
mcu_name.split()[-1],
mcu_obj.get_status()["mcu_version"],
)
)
else:
msg_updated.append(
"%s: Current version %s"
% (n.split()[-1], mcu_obj.get_status()["mcu_version"])
% (
mcu_name.split()[-1],
mcu_obj.get_status()["mcu_version"],
)
)

if len(msg_updated) == 0:
if not len(msg_updated):
msg_updated.append("<none>")

version_msg = [
Expand Down

0 comments on commit 2adbeba

Please sign in to comment.