Refactor
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user