PEP8, typos and warnings fixes

This commit is contained in:
alfrix authored and Alfredo Monclus committed 2022-05-31 11:14:42 -03:00
1 parent fd2a717ece
commit 5a36729b76
40 files changed
+335 -296

No files matched your search

+5 -3
View File
@@ -7,9 +7,11 @@ from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrinterSelect")
def create_panel(*args):
return PrinterSelect(*args)
class PrinterSelect(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
super().__init__(screen, title, False, False, False)
@@ -32,7 +34,7 @@ class PrinterSelect(ScreenPanel):
if length == 4:
# Arrange 2 x 2
columns = 2
elif length > 4 and length <= 6:
elif 4 < length <= 6:
# Arrange 3 x 2
columns = 3
else:
@@ -44,8 +46,8 @@ class PrinterSelect(ScreenPanel):
self.labels[name].connect("clicked", self._screen.connect_printer_widget, name)
if self._screen.vertical_mode:
row = i % columns
col = int(i/columns)
col = int(i / columns)
else:
col = i % columns
row = int(i/columns)
row = int(i / columns)
grid.attach(self.labels[name], col, row, 1, 1)