Commit 3d6bff88 authored by Guillaume Seguin's avatar Guillaume Seguin

Please pep8/flake8

parent 6d11974a
...@@ -483,9 +483,9 @@ class pronsole(cmd.Cmd): ...@@ -483,9 +483,9 @@ class pronsole(cmd.Cmd):
"macro": "%(bold)s..>%(normal)s ", "macro": "%(bold)s..>%(normal)s ",
"online": "%(bold)sT:%(extruder_temp_fancy)s %(progress_fancy)s >%(normal)s "} "online": "%(bold)sT:%(extruder_temp_fancy)s %(progress_fancy)s >%(normal)s "}
## -------------------------------------------------------------- # --------------------------------------------------------------
## General console handling # General console handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def postloop(self): def postloop(self):
self.p.disconnect() self.p.disconnect()
...@@ -696,9 +696,9 @@ class pronsole(cmd.Cmd): ...@@ -696,9 +696,9 @@ class pronsole(cmd.Cmd):
def help_exit(self): def help_exit(self):
self.log(_("Disconnects from the printer and exits the program.")) self.log(_("Disconnects from the printer and exits the program."))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Macro handling # Macro handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def complete_macro(self, text, line, begidx, endidx): def complete_macro(self, text, line, begidx, endidx):
if (len(line.split()) == 2 and line[-1] != " ") or (len(line.split()) == 1 and line[-1] == " "): if (len(line.split()) == 2 and line[-1] != " ") or (len(line.split()) == 1 and line[-1] == " "):
...@@ -835,9 +835,9 @@ class pronsole(cmd.Cmd): ...@@ -835,9 +835,9 @@ class pronsole(cmd.Cmd):
else: else:
self.logError("Macro '" + macro_name + "' is not defined") self.logError("Macro '" + macro_name + "' is not defined")
## -------------------------------------------------------------- # --------------------------------------------------------------
## Configuration handling # Configuration handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def set(self, var, str): def set(self, var, str):
try: try:
...@@ -955,9 +955,9 @@ class pronsole(cmd.Cmd): ...@@ -955,9 +955,9 @@ class pronsole(cmd.Cmd):
finally: finally:
del rci, rco del rci, rco
## -------------------------------------------------------------- # --------------------------------------------------------------
## Configuration update callbacks # Configuration update callbacks
## -------------------------------------------------------------- # --------------------------------------------------------------
def update_build_dimensions(self, param, value): def update_build_dimensions(self, param, value):
self.build_dimensions_list = parse_build_dimensions(value) self.build_dimensions_list = parse_build_dimensions(value)
...@@ -966,9 +966,9 @@ class pronsole(cmd.Cmd): ...@@ -966,9 +966,9 @@ class pronsole(cmd.Cmd):
def update_tcp_streaming_mode(self, param, value): def update_tcp_streaming_mode(self, param, value):
self.p.tcp_streaming_mode = self.settings.tcp_streaming_mode self.p.tcp_streaming_mode = self.settings.tcp_streaming_mode
## -------------------------------------------------------------- # --------------------------------------------------------------
## Command line options handling # Command line options handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def add_cmdline_arguments(self, parser): def add_cmdline_arguments(self, parser):
parser.add_argument('-c', '--conf', '--config', help = _("load this file on startup instead of .pronsolerc ; you may chain config files, if so settings auto-save will use the last specified file"), action = "append", default = []) parser.add_argument('-c', '--conf', '--config', help = _("load this file on startup instead of .pronsolerc ; you may chain config files, if so settings auto-save will use the last specified file"), action = "append", default = [])
...@@ -998,9 +998,9 @@ class pronsole(cmd.Cmd): ...@@ -998,9 +998,9 @@ class pronsole(cmd.Cmd):
args = parser.parse_args(args = args) args = parser.parse_args(args = args)
self.process_cmdline_arguments(args) self.process_cmdline_arguments(args)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Printer connection handling # Printer connection handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def do_connect(self, l): def do_connect(self, l):
a = l.split() a = l.split()
...@@ -1085,9 +1085,9 @@ class pronsole(cmd.Cmd): ...@@ -1085,9 +1085,9 @@ class pronsole(cmd.Cmd):
self.log("Blocks until printer is online") self.log("Blocks until printer is online")
self.log("Warning: if something goes wrong, this can block pronsole forever") self.log("Warning: if something goes wrong, this can block pronsole forever")
## -------------------------------------------------------------- # --------------------------------------------------------------
## File loading handling # File loading handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def do_load(self, filename): def do_load(self, filename):
self._do_load(filename) self._do_load(filename)
...@@ -1176,9 +1176,9 @@ class pronsole(cmd.Cmd): ...@@ -1176,9 +1176,9 @@ class pronsole(cmd.Cmd):
self.log(_("slice filename.stl view - create gcode file and view using skeiniso (if using skeinforge)")) self.log(_("slice filename.stl view - create gcode file and view using skeiniso (if using skeinforge)"))
self.log(_("slice set - adjust slicer settings")) self.log(_("slice set - adjust slicer settings"))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Print/upload handling # Print/upload handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def do_upload(self, l): def do_upload(self, l):
names = l.split() names = l.split()
...@@ -1372,9 +1372,9 @@ class pronsole(cmd.Cmd): ...@@ -1372,9 +1372,9 @@ class pronsole(cmd.Cmd):
if (len(line.split()) == 2 and line[-1] != " ") or (len(line.split()) == 1 and line[-1] == " "): if (len(line.split()) == 2 and line[-1] != " ") or (len(line.split()) == 1 and line[-1] == " "):
return [i for i in self.sdfiles if i.startswith(text)] return [i for i in self.sdfiles if i.startswith(text)]
## -------------------------------------------------------------- # --------------------------------------------------------------
## Printcore callbacks # Printcore callbacks
## -------------------------------------------------------------- # --------------------------------------------------------------
def startcb(self, resuming = False): def startcb(self, resuming = False):
self.starttime = time.time() self.starttime = time.time()
...@@ -1464,9 +1464,9 @@ class pronsole(cmd.Cmd): ...@@ -1464,9 +1464,9 @@ class pronsole(cmd.Cmd):
def help_eta(self): def help_eta(self):
self.log(_("Displays estimated remaining print time.")) self.log(_("Displays estimated remaining print time."))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Temperature handling # Temperature handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def set_temp_preset(self, key, value): def set_temp_preset(self, key, value):
if not key.startswith("bed"): if not key.startswith("bed"):
...@@ -1600,9 +1600,9 @@ class pronsole(cmd.Cmd): ...@@ -1600,9 +1600,9 @@ class pronsole(cmd.Cmd):
self.log(_("monitor - Reports temperature and SD print status (if SD printing) every 5 seconds")) self.log(_("monitor - Reports temperature and SD print status (if SD printing) every 5 seconds"))
self.log(_("monitor 2 - Reports temperature and SD print status (if SD printing) every 2 seconds")) self.log(_("monitor 2 - Reports temperature and SD print status (if SD printing) every 2 seconds"))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Manual printer controls # Manual printer controls
## -------------------------------------------------------------- # --------------------------------------------------------------
def do_tool(self, l): def do_tool(self, l):
tool = None tool = None
...@@ -1803,9 +1803,9 @@ class pronsole(cmd.Cmd): ...@@ -1803,9 +1803,9 @@ class pronsole(cmd.Cmd):
def help_off(self): def help_off(self):
self.log(_("Turns off everything on the printer")) self.log(_("Turns off everything on the printer"))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Host commands handling # Host commands handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def process_host_command(self, command): def process_host_command(self, command):
"""Override host command handling""" """Override host command handling"""
......
...@@ -238,9 +238,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -238,9 +238,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if self.settings.monitor: if self.settings.monitor:
self.update_monitor() self.update_monitor()
## -------------------------------------------------------------- # --------------------------------------------------------------
## Main interface handling # Main interface handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def reset_ui(self): def reset_ui(self):
MainWindow.reset_ui(self) MainWindow.reset_ui(self)
...@@ -321,9 +321,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -321,9 +321,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx.CallAfter(self.gwindow.Destroy) wx.CallAfter(self.gwindow.Destroy)
wx.CallAfter(self.Destroy) wx.CallAfter(self.Destroy)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Main interface actions # Main interface actions
## -------------------------------------------------------------- # --------------------------------------------------------------
def do_monitor(self, l = ""): def do_monitor(self, l = ""):
if l.strip() == "": if l.strip() == "":
...@@ -610,9 +610,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -610,9 +610,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.zb.repeatLast() self.zb.repeatLast()
self.xyb.repeatLast() self.xyb.repeatLast()
## -------------------------------------------------------------- # --------------------------------------------------------------
## Console handling # Console handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def catchprint(self, l): def catchprint(self, l):
"""Called by the Tee operator to write to the log box""" """Called by the Tee operator to write to the log box"""
...@@ -652,9 +652,9 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -652,9 +652,9 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.commandbox.history.append(command) self.commandbox.history.append(command)
self.commandbox.histindex = len(self.commandbox.history) self.commandbox.histindex = len(self.commandbox.history)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Main menu handling & actions # Main menu handling & actions
## -------------------------------------------------------------- # --------------------------------------------------------------
def create_menu(self): def create_menu(self):
"""Create main menu""" """Create main menu"""
...@@ -782,9 +782,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -782,9 +782,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx.AboutBox(info) wx.AboutBox(info)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Settings & command line handling (including update callbacks) # Settings & command line handling (including update callbacks)
## -------------------------------------------------------------- # --------------------------------------------------------------
def _add_settings(self, size): def _add_settings(self, size):
self.settings._add(BooleanSetting("monitor", True, _("Monitor printer status"), _("Regularly monitor printer temperatures (required to have functional temperature graph or gauges)"), "Printer"), self.update_monitor) self.settings._add(BooleanSetting("monitor", True, _("Monitor printer status"), _("Regularly monitor printer temperatures (required to have functional temperature graph or gauges)"), "Printer"), self.update_monitor)
...@@ -912,9 +912,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -912,9 +912,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
else: else:
wx.CallAfter(self.graph.StopPlotting) wx.CallAfter(self.graph.StopPlotting)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Statusbar handling # Statusbar handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def statuschecker(self): def statuschecker(self):
while self.statuscheck: while self.statuscheck:
...@@ -973,9 +973,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -973,9 +973,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
pass pass
wx.CallAfter(self.statusbar.SetStatusText, _("Not connected to printer.")) wx.CallAfter(self.statusbar.SetStatusText, _("Not connected to printer."))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Interface lock handling # Interface lock handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def lock(self, event = None, force = None): def lock(self, event = None, force = None):
if force is not None: if force is not None:
...@@ -989,9 +989,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -989,9 +989,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
for panel in self.panels: for panel in self.panels:
panel.Enable() panel.Enable()
## -------------------------------------------------------------- # --------------------------------------------------------------
## Printer connection handling # Printer connection handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def connect(self, event = None): def connect(self, event = None):
self.log(_("Connecting...")) self.log(_("Connecting..."))
...@@ -1095,9 +1095,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1095,9 +1095,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
wx.CallAfter(self.toolbarsizer.Layout) wx.CallAfter(self.toolbarsizer.Layout)
dlg.Destroy() dlg.Destroy()
## -------------------------------------------------------------- # --------------------------------------------------------------
## Print/upload handling # Print/upload handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def on_startprint(self): def on_startprint(self):
wx.CallAfter(self.pausebtn.SetLabel, _("Pause")) wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
...@@ -1195,9 +1195,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1195,9 +1195,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.on_startprint() self.on_startprint()
self.p.startprint(self.predisconnect_mainqueue, self.p.queueindex) self.p.startprint(self.predisconnect_mainqueue, self.p.queueindex)
## -------------------------------------------------------------- # --------------------------------------------------------------
## File loading handling # File loading handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def filesloaded(self): def filesloaded(self):
dlg = wx.SingleChoiceDialog(self, _("Select the file to print"), _("Pick SD file"), self.sdfiles) dlg = wx.SingleChoiceDialog(self, _("Select the file to print"), _("Pick SD file"), self.sdfiles)
...@@ -1447,9 +1447,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1447,9 +1447,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
# finalized model from the main visualization # finalized model from the main visualization
self.gwindow.p.addfile(gcode) self.gwindow.p.addfile(gcode)
## -------------------------------------------------------------- # --------------------------------------------------------------
## Printcore callbacks # Printcore callbacks
## -------------------------------------------------------------- # --------------------------------------------------------------
def process_host_command(self, command): def process_host_command(self, command):
"""Override host command handling""" """Override host command handling"""
...@@ -1697,9 +1697,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1697,9 +1697,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
except: except:
pass pass
## -------------------------------------------------------------- # --------------------------------------------------------------
## Custom buttons handling # Custom buttons handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def cbuttons_reload(self): def cbuttons_reload(self):
allcbs = getattr(self, "custombuttons_widgets", []) allcbs = getattr(self, "custombuttons_widgets", [])
...@@ -2002,9 +2002,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -2002,9 +2002,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.cur_button = None self.cur_button = None
raise raise
## -------------------------------------------------------------- # --------------------------------------------------------------
## Macros handling # Macros handling
## -------------------------------------------------------------- # --------------------------------------------------------------
def start_macro(self, macro_name, old_macro_definition = ""): def start_macro(self, macro_name, old_macro_definition = ""):
if not self.processing_rc: if not self.processing_rc:
...@@ -2084,9 +2084,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -2084,9 +2084,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
for macro in self.macros.keys(): for macro in self.macros.keys():
self.Bind(wx.EVT_MENU, lambda x, m = macro: self.start_macro(m, self.macros[m]), self.macros_menu.Append(-1, macro)) self.Bind(wx.EVT_MENU, lambda x, m = macro: self.start_macro(m, self.macros[m]), self.macros_menu.Append(-1, macro))
## -------------------------------------------------------------- # --------------------------------------------------------------
## Slic3r integration # Slic3r integration
## -------------------------------------------------------------- # --------------------------------------------------------------
def load_slic3r_configs(self, menus): def load_slic3r_configs(self, menus):
"""List Slic3r configurations and create menu""" """List Slic3r configurations and create menu"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment