Remove unused variables

This commit is contained in:
alfrix 2022-03-14 19:21:39 -03:00 committed by Alfredo Monclus
parent 5899c8feab
commit ee0cc9ca10
12 changed files with 10 additions and 25 deletions

View File

@ -90,8 +90,8 @@ class KlipperScreenConfig:
for printer in conf_printers_debug:
name = list(printer)[0]
item = conf_printers_debug[conf_printers_debug.index(printer)]
if item[list(printer)[0]]['moonraker_api_key'] != "":
item[list(printer)[0]]['moonraker_api_key'] = "redacted"
if item[name]['moonraker_api_key'] != "":
item[name]['moonraker_api_key'] = "redacted"
logging.debug("Configured printers: %s" % json.dumps(conf_printers_debug, indent=2))
lang = self.get_main_config_option("language", None)

View File

@ -23,7 +23,6 @@ class ScreenPanel:
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
action_bar_width = self._gtk.get_action_bar_width() if action_bar is True else 0
self.content = Gtk.Box(spacing=0)
def initialize(self, panel_name):

View File

@ -156,7 +156,6 @@ class HeaterGraph(Gtk.DrawingArea):
return hscale
def graph_time(self, ctx, gsize, points_per_pixel):
glen = gsize[1][0] - gsize[0][0]
now = datetime.datetime.now()
first = gsize[1][0] - (now.second + ((now.minute % 2) * 60)) / points_per_pixel

View File

@ -46,7 +46,6 @@ class Keypad(Gtk.Box):
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['entry'] = Gtk.Entry()
self.labels['entry'].props.xalign = 0.5
ctx = self.labels['entry'].get_style_context()
b = self._gtk.ButtonImage('cancel', _('Close'), None, 1, 1)
b.connect("clicked", close_function)

View File

@ -61,8 +61,6 @@ class BedLevelPanel(ScreenPanel):
if (("bltouch" in self._screen.printer.get_config_section_list() or
"probe" in self._screen.printer.get_config_section_list()) and
config_section_name == "screws_tilt_adjust"):
x_offset = 0
y_offset = 0
if "bltouch" in self._screen.printer.get_config_section_list():
bltouch = self._screen.printer.get_config_section("bltouch")
if "x_offset" in bltouch:

View File

@ -377,7 +377,7 @@ class BedMeshPanel(ScreenPanel):
buttons = [
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, buttons, box, self._close_dialog)
self._gtk.Dialog(self._screen, buttons, box, self._close_dialog)
alloc = canvas_box.get_allocation()
canvas = FigureCanvas(fig)

View File

@ -300,7 +300,7 @@ class JobStatusPanel(ScreenPanel):
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
self.disable_button("pause", "cancel")
def cancel_confirm(self, widget, response_id):
@ -379,7 +379,6 @@ class JobStatusPanel(ScreenPanel):
)
ps = self._printer.get_stat("print_stats")
vsd = self._printer.get_stat("virtual_sdcard")
self.update_message()
if "toolhead" in data:

View File

@ -336,8 +336,6 @@ class MainPanel(MenuPanel):
def update_graph(self):
self.labels['da'].queue_draw()
alloc = self.labels['devices'].get_allocation()
alloc = self.labels['da'].get_allocation()
return True
def update_temp(self, device, temp, target):

View File

@ -313,7 +313,7 @@ class PrintPanel(ScreenPanel):
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
def confirm_print_response(self, widget, response_id, filename):
widget.destroy()

View File

@ -166,7 +166,7 @@ class SystemPanel(ScreenPanel):
{"name": _("Recover Soft"), "response": Gtk.ResponseType.APPLY},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, recoverybuttons, scroll, self.reset_confirm, program)
self._gtk.Dialog(self._screen, recoverybuttons, scroll, self.reset_confirm, program)
return
else:
if info['version'] == info['remote_version']:
@ -233,7 +233,7 @@ class SystemPanel(ScreenPanel):
{"name": _("Update"), "response": Gtk.ResponseType.OK},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.update_confirm, program)
self._gtk.Dialog(self._screen, buttons, scroll, self.update_confirm, program)
def update_confirm(self, widget, response_id, program):
if response_id == Gtk.ResponseType.OK:

View File

@ -532,8 +532,6 @@ class TemperaturePanel(ScreenPanel):
def update_graph(self):
self.labels['da'].queue_draw()
alloc = self.labels['devices'].get_allocation()
alloc = self.labels['da'].get_allocation()
return True
def update_temp(self, device, temp, target):

View File

@ -368,8 +368,6 @@ class KlipperScreen(Gtk.Window):
box.pack_end(close, False, False, 0)
box.set_halign(Gtk.Align.CENTER)
cur_panel = self.panels[self._cur_panels[-1]]
self.base_panel.get().put(box, 0, 0)
self.show_all()
@ -406,7 +404,7 @@ class KlipperScreen(Gtk.Window):
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self.gtk.Dialog(self, buttons, label, self.error_modal_response)
self.gtk.Dialog(self, buttons, label, self.error_modal_response)
def error_modal_response(self, widget, response_id):
widget.destroy()
@ -429,7 +427,7 @@ class KlipperScreen(Gtk.Window):
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self.gtk.Dialog(self, buttons, label, self.restart_ks)
self.gtk.Dialog(self, buttons, label, self.restart_ks)
def restart_ks(self, widget, response_id):
if response_id == Gtk.ResponseType.OK:
@ -510,7 +508,6 @@ class KlipperScreen(Gtk.Window):
# self._remove_current_panel(False)
# Find current menu item
panels = list(self._cur_panels)
if "main_panel" in self._cur_panels:
menu = "__main"
elif "splash_screen" in self._cur_panels:
@ -567,7 +564,6 @@ class KlipperScreen(Gtk.Window):
self._remove_current_panel()
def add_subscription(self, panel_name):
add = True
for sub in self.subscriptions:
if sub == panel_name:
return
@ -594,7 +590,6 @@ class KlipperScreen(Gtk.Window):
box.set_halign(Gtk.Align.CENTER)
box.get_style_context().add_class("screensaver")
cur_panel = self.panels[self._cur_panels[-1]]
self.base_panel.get().put(box, 0, 0)
self.show_all()
self.screensaver = box
@ -852,7 +847,7 @@ class KlipperScreen(Gtk.Window):
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
def _confirm_send_action_response(self, widget, response_id, method, params):
if response_id == Gtk.ResponseType.OK: