Make sure all except statements are no longer empty, should help a lot with debugging.
This commit is contained in:
@ -27,8 +27,8 @@ class command():
|
||||
speechDriver = self.env['runtime']['speechDriver']
|
||||
speechDriver.shutdown()
|
||||
speechDriver.initialize(self.env)
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f'revert_to_saved speechDriver: Error reinitializing speech driver: {str(e)}')
|
||||
|
||||
# Reinitialize sound system with restored settings
|
||||
if 'soundDriver' in self.env['runtime']:
|
||||
@ -36,8 +36,8 @@ class command():
|
||||
soundDriver = self.env['runtime']['soundDriver']
|
||||
soundDriver.shutdown()
|
||||
soundDriver.initialize(self.env)
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f'revert_to_saved soundDriver: Error reinitializing sound driver: {str(e)}')
|
||||
|
||||
self.env['runtime']['outputManager'].presentText("Successfully reverted to saved settings", interrupt=False, flush=False)
|
||||
self.env['runtime']['outputManager'].presentText("All temporary changes have been discarded", interrupt=False, flush=False)
|
||||
|
@ -38,7 +38,7 @@ class command():
|
||||
runtimeValue = runtimeSettings[section][option]
|
||||
try:
|
||||
fileValue = fileConfig[section][option]
|
||||
except:
|
||||
except Exception as e:
|
||||
fileValue = ""
|
||||
|
||||
if runtimeValue != fileValue:
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
try:
|
||||
# Get current pitch
|
||||
currentPitch = float(self.env['runtime']['settingsManager'].getSetting('speech', 'pitch'))
|
||||
except:
|
||||
except Exception as e:
|
||||
currentPitch = 0.5
|
||||
|
||||
# Present current pitch
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
try:
|
||||
# Get current rate
|
||||
currentRate = float(self.env['runtime']['settingsManager'].getSetting('speech', 'rate'))
|
||||
except:
|
||||
except Exception as e:
|
||||
currentRate = 0.5
|
||||
|
||||
# Present current rate
|
||||
|
@ -18,7 +18,7 @@ class command():
|
||||
# Get current rate from runtime settings (may be temporary)
|
||||
settingsManager = self.env['runtime']['settingsManager']
|
||||
currentRate = float(settingsManager.getSetting('speech', 'rate'))
|
||||
except:
|
||||
except Exception as e:
|
||||
currentRate = 0.5
|
||||
|
||||
# Present current rate
|
||||
@ -38,8 +38,8 @@ class command():
|
||||
if 'speechDriver' in self.env['runtime']:
|
||||
try:
|
||||
self.env['runtime']['speechDriver'].setRate(newRate)
|
||||
except:
|
||||
pass
|
||||
except Exception as e:
|
||||
print(f'adjust_speech_rate setRate: Error setting speech rate: {str(e)}')
|
||||
|
||||
newPercent = int(newRate * 100)
|
||||
self.env['runtime']['outputManager'].presentText(f"Speech rate temporarily set to {newPercent} percent", interrupt=False, flush=False)
|
||||
|
@ -17,7 +17,7 @@ class command():
|
||||
try:
|
||||
# Get current volume
|
||||
currentVolume = float(self.env['runtime']['settingsManager'].getSetting('speech', 'volume'))
|
||||
except:
|
||||
except Exception as e:
|
||||
currentVolume = 1.0
|
||||
|
||||
# Present current volume
|
||||
|
@ -38,19 +38,19 @@ class command():
|
||||
try:
|
||||
ratePercent = int(float(rate) * 100)
|
||||
self.env['runtime']['outputManager'].presentText(f"Rate: {ratePercent} percent", interrupt=True)
|
||||
except:
|
||||
except Exception as e:
|
||||
self.env['runtime']['outputManager'].presentText(f"Rate: {rate}", interrupt=True)
|
||||
|
||||
try:
|
||||
pitchPercent = int(float(pitch) * 100)
|
||||
self.env['runtime']['outputManager'].presentText(f"Pitch: {pitchPercent} percent", interrupt=True)
|
||||
except:
|
||||
except Exception as e:
|
||||
self.env['runtime']['outputManager'].presentText(f"Pitch: {pitch}", interrupt=True)
|
||||
|
||||
try:
|
||||
volumePercent = int(float(volume) * 100)
|
||||
self.env['runtime']['outputManager'].presentText(f"Volume: {volumePercent} percent", interrupt=True)
|
||||
except:
|
||||
except Exception as e:
|
||||
self.env['runtime']['outputManager'].presentText(f"Volume: {volume}", interrupt=True)
|
||||
|
||||
self.env['runtime']['outputManager'].playSound('Accept')
|
||||
|
Reference in New Issue
Block a user