From ee8f5f9170d7c321e82305b0c4197fb6c5b3ac91 Mon Sep 17 00:00:00 2001 From: jbernardis Date: Sat, 7 Feb 2015 23:38:12 -0500 Subject: [PATCH] Configtool: some code prettifications. Pure whitespace changes. --- configtool.py | 5 +++++ configtool/addsensordlg.py | 2 +- configtool/build.py | 6 +++--- configtool/miscellaneouspage.py | 2 +- configtool/sensorpage.py | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/configtool.py b/configtool.py index 876579d..5983d1b 100755 --- a/configtool.py +++ b/configtool.py @@ -245,6 +245,7 @@ class ConfigFrame(wx.Frame): def loadConfigFile(self, fn): if not self.pgPrinter.confirmLoseChanges("load config"): return + if not self.pgBoard.confirmLoseChanges("load config"): return @@ -377,6 +378,7 @@ class ConfigFrame(wx.Frame): dlg.Destroy() if rc != wx.ID_YES: return + self.onSavePrinterConfig(None) if self.pgBoard.isModified(): @@ -388,6 +390,7 @@ class ConfigFrame(wx.Frame): dlg.Destroy() if rc != wx.ID_YES: return + self.onSaveBoardConfig(None) if not self.verifyConfigLoaded(): @@ -409,12 +412,14 @@ class ConfigFrame(wx.Frame): dlg.ShowModal() dlg.Destroy() return + if not f_cpu: dlg = wx.MessageDialog(self, "Unable to determine CPU clock rate.", "CPU clock rate error", wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy() return + if not baud: # TODO: It looks like serial port baud rate is confused with bootloader # baud rate here. These two can be the same, but don't have to. diff --git a/configtool/addsensordlg.py b/configtool/addsensordlg.py index d0174b0..7fbf0e3 100644 --- a/configtool/addsensordlg.py +++ b/configtool/addsensordlg.py @@ -91,7 +91,7 @@ class AddSensorDlg(wx.Dialog): csz.Add(lsz) - csz.AddSpacer((10,10)) + csz.AddSpacer((10, 10)) bsz = wx.BoxSizer(wx.HORIZONTAL) diff --git a/configtool/build.py b/configtool/build.py index 97522c4..cc9b3dc 100644 --- a/configtool/build.py +++ b/configtool/build.py @@ -178,7 +178,7 @@ class Build(wx.Dialog): cmdpath = "avr-gcc" cfiles = [f for f in os.listdir(self.root) - if isfile(join(self.root,f)) and f.endswith(".c")] + if isfile(join(self.root,f)) and f.endswith(".c")] for f in cfiles: basename = f[:-2] ofile = basename + ".o" @@ -202,8 +202,8 @@ class Build(wx.Dialog): cmdpath = "avr-gcc" ofiles = ["\"" + join(self.root, "build", f) + "\"" - for f in os.listdir(join(self.root, "build")) - if isfile(join(self.root, "build", f)) and f.endswith(".o")] + for f in os.listdir(join(self.root, "build")) + if isfile(join(self.root, "build", f)) and f.endswith(".o")] opath = " ".join(ofiles) elfpath = "\"" + join(self.root, "build", "teacup.elf") + "\"" hexpath = "\"" + join(self.root, "teacup.hex") + "\"" diff --git a/configtool/miscellaneouspage.py b/configtool/miscellaneouspage.py index 61782c4..4ef251b 100644 --- a/configtool/miscellaneouspage.py +++ b/configtool/miscellaneouspage.py @@ -127,7 +127,7 @@ class MiscellaneousPage(wx.Panel, Page): sbox.Add(tc) sbox.AddSpacer((5, 5)) - sz.Add(sbox, pos = (8,3), flag = wx.ALIGN_CENTER_HORIZONTAL) + sz.Add(sbox, pos = (8, 3), flag = wx.ALIGN_CENTER_HORIZONTAL) labelWidth = 190; diff --git a/configtool/sensorpage.py b/configtool/sensorpage.py index 55ec662..f9cb67b 100644 --- a/configtool/sensorpage.py +++ b/configtool/sensorpage.py @@ -17,7 +17,7 @@ class SensorsPage(wx.Panel, Page): self.sensorTypeKeys = {'TT_MAX6675': 'TEMP_MAX6675', 'TT_THERMISTOR': 'TEMP_THERMISTOR', 'TT_AD595': 'TEMP_AD595', 'TT_PT100': 'TEMP_PT100', - 'TT_INTERCOM': 'TEMP_INTERCOM' } + 'TT_INTERCOM': 'TEMP_INTERCOM'} self.labels = {'TEMP_MAX6675': "MAX6675", 'TEMP_THERMISTOR': "Thermistor", 'TEMP_AD595': "AD595", 'TEMP_PT100': "PT100", 'TEMP_INTERCOM': "Intercom"}