Configtool: some code prettifications.

Pure whitespace changes.
This commit is contained in:
jbernardis 2015-02-07 23:38:12 -05:00 committed by Markus Hitter
parent 2436ac2865
commit ee8f5f9170
5 changed files with 11 additions and 6 deletions

View File

@ -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.

View File

@ -91,7 +91,7 @@ class AddSensorDlg(wx.Dialog):
csz.Add(lsz)
csz.AddSpacer((10,10))
csz.AddSpacer((10, 10))
bsz = wx.BoxSizer(wx.HORIZONTAL)

View File

@ -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") + "\""

View File

@ -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;

View File

@ -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"}