Skip speechd config files that don't exist.

This commit is contained in:
Storm Dragon
2026-04-16 21:56:47 -04:00
parent adc9d9a6c7
commit b236bac035
+6 -1
View File
@@ -44,6 +44,11 @@ def update_speechd_config_content(content, rate, volume, pitch):
return newContent
def get_writable_config_targets(configTargets):
"""Return existing config paths to update, preserving order."""
return [configPath for configPath in configTargets if os.path.exists(configPath)]
class SpeechRateMenu:
def __init__(self, title="Speech Configuration"):
self.title = title
@@ -122,7 +127,7 @@ class SpeechRateMenu:
def save_settings_to_config(self):
"""Save the current settings to the speech-dispatcher config file"""
try:
for configPath in self.configTargets:
for configPath in get_writable_config_targets(self.configTargets):
with open(configPath, 'r') as f:
content = f.read()