#Leave ISP does not reset the serial port, only resets the device, and returns the serial port after disconnecting it from the programming interface.
# This allows you to use the serial port without opening it again.
def leaveISP(self):
- if self.serial != None:
+ if self.serial is not None:
if self.sendMessage([0x11]) != [0x11, 0x00]:
raise ispBase.IspError("Failed to leave programming mode")
ret = self.serial
return None
def isConnected(self):
- return self.serial != None
+ return self.serial is not None
def sendISP(self, data):
recv = self.sendMessage([0x1D, 4, 4, 0, data[0], data[1], data[2], data[3]])
size[0] = width
child.SetBestSize(size)
-class TitleRow():
+class TitleRow(object):
def __init__(self, panel, name):
"Add a title row to the configuration panel"
sizer = panel.GetSizer()
sizer.Add(wx.StaticLine(panel), (x+1,0), (1,3), flag=wx.EXPAND|wx.LEFT,border=10)
sizer.SetRows(x + 2)
-class SettingRow():
+class SettingRow(object):
def __init__(self, panel, configName, valueOverride = None):
"Add a setting to the configuration panel"
sizer = panel.GetSizer()
#Settings notify works as a validator, but instead of validating anything, it calls another function, which can use the value.
# A bit hacky, bit it works.
-class settingNotify():
+class settingNotify(object):
def __init__(self, setting, func):
self.setting = setting
self.setting.validators.append(self)
if set.isPreference():
if profileParser.has_option('preference', set.getName()):
set.setValue(unicode(profileParser.get('preference', set.getName()), 'utf-8', 'replace'))
+ elif set.isMachineSetting():
+ if profileParser.has_option('machine', set.getName()):
+ set.setValue(unicode(profileParser.get('machine', set.getName()), 'utf-8', 'replace'))
def savePreferences(filename):
#Save the current profile to an ini file