Use f-strings
Avoid unnecessary casts to str()bool()int()
Ensure file closure
Merge nested ifs
Simplify for-assigns-appends with comprehensions and internal functions
Avoid shadowing internal function names
Initialize variables
Return value directly instead of assign then return
Make some methods static
This commit is contained in:
alfrix
2022-07-04 20:50:34 -03:00
committed by Alfredo Monclus
parent 68d4f9c534
commit 6510b2ec6b
55 changed files with 1607 additions and 1798 deletions

View File

@@ -38,7 +38,7 @@ class PrinterSelect(ScreenPanel):
for i, printer in enumerate(printers):
name = list(printer)[0]
self.labels[name] = self._gtk.ButtonImage("extruder", name, "color%s" % (1 + i % 4))
self.labels[name] = self._gtk.ButtonImage("extruder", name, f"color{1 + i % 4}")
self.labels[name].connect("clicked", self._screen.connect_printer_widget, name)
if self._screen.vertical_mode:
row = i % columns