if self.sendMessage([0x10, 0xc8, 0x64, 0x19, 0x20, 0x00, 0x53, 0x03, 0xac, 0x53, 0x00, 0x00]) != [0x10, 0x00]:
self.close()
raise ispBase.IspError("Failed to enter programming mode")
+ self.serial.timeout = 5
def close(self):
if self.serial != None:
try:
self.serial.write(message)
self.serial.flush()
- except SerialTimeoutException:
+ except Serial.SerialTimeoutException:
raise ispBase.IspError('Serial send timeout')
self.seq = (self.seq + 1) & 0xFF
return self.recvMessage()
#Read a configuration file as global config
global globalProfileParser
globalProfileParser = ConfigParser.ConfigParser()
- globalProfileParser.read(filename)
+ try:
+ globalProfileParser.read(filename)
+ except ConfigParser.ParsingError:
+ pass
def resetGlobalProfile():
#Read a configuration file as global config
global globalPreferenceParser
if globalPreferenceParser is None:
globalPreferenceParser = ConfigParser.ConfigParser()
- globalPreferenceParser.read(getPreferencePath())
+ try:
+ globalPreferenceParser.read(getPreferencePath())
+ except ConfigParser.ParsingError:
+ pass
if not globalPreferenceParser.has_option('preference', name):
if name in preferencesDefaultSettings:
default = preferencesDefaultSettings[name]
global globalPreferenceParser
if globalPreferenceParser == None:
globalPreferenceParser = ConfigParser.ConfigParser()
- globalPreferenceParser.read(getPreferencePath())
+ try:
+ globalPreferenceParser.read(getPreferencePath())
+ except ConfigParser.ParsingError:
+ pass
if not globalPreferenceParser.has_section('preference'):
globalPreferenceParser.add_section('preference')
globalPreferenceParser.set('preference', name, unicode(value).encode("utf-8"))