A few bug fixes, better checking in place to make sure syntax and other errors do not make it to commits.

This commit is contained in:
Storm Dragon
2025-07-24 18:34:12 -04:00
18 changed files with 2283 additions and 18 deletions

View File

@@ -24,9 +24,8 @@ class command:
def run(self):
try:
self.env["runtime"]["OutputManager"].present_text(
f"Fenrir screen reader version {
fenrirVersion.version}-{
fenrirVersion.code_name}",
f"Fenrir screen reader version "
f"{fenrirVersion.version}-{fenrirVersion.code_name}",
interrupt=True,
)
except Exception as e:

View File

@@ -393,12 +393,10 @@ class command:
"""Check if text contains URLs that might cause false progress detection"""
import re
# Common URL patterns that might contain progress-like patterns
# Specific URL patterns - only match actual URLs, not filenames
url_patterns = [
r"https?://[^\s]+", # http:// or https:// URLs
r"ftp://[^\s]+", # ftp:// URLs
r"www\.[^\s]+", # www. domains
r"[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}[/\w.-]*", # domain.com/path patterns
r"\S+://\S+\.\S{2,}", # Any protocol:// with domain.ext
r"www\.[^\s]+\.[a-zA-Z]{2,}", # www.domain.ext patterns
]
for pattern in url_patterns:

View File

@@ -59,8 +59,7 @@ class command(config_command):
except Exception as e:
self.present_text(
f"Failed to reset configuration: {
str(e)}",
f"Failed to reset configuration: {str(e)}",
interrupt=False,
flush=False,
)

View File

@@ -34,8 +34,7 @@ class command:
SpeechDriver.initialize(self.env)
except Exception as e:
print(
f"revert_to_saved SpeechDriver: Error reinitializing speech driver: {
str(e)}"
f"revert_to_saved SpeechDriver: Error reinitializing speech driver: {str(e)}"
)
# Reinitialize sound system with restored settings

View File

@@ -45,8 +45,7 @@ class command:
self.env["runtime"]["SpeechDriver"].set_rate(new_rate)
except Exception as e:
print(
f"adjust_speech_rate set_rate: Error setting speech rate: {
str(e)}"
f"adjust_speech_rate set_rate: Error setting speech rate: {str(e)}"
)
new_percent = int(new_rate * 100)

View File

@@ -29,9 +29,7 @@ class DynamicVoiceCommand:
def run(self):
try:
self.env["runtime"]["OutputManager"].present_text(
f"Testing voice {
self.voice} from {
self.module}. Please wait.",
f"Testing voice {self.voice} from {self.module}. Please wait.",
interrupt=True,
)

View File

@@ -4,5 +4,5 @@
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributors.
version = "2025.07.19"
version = "2025.07.24"
code_name = "master"

View File

@@ -561,6 +561,15 @@ class driver(inputDriver):
# 0 = Numlock
# 1 = Capslock
# 2 = Rollen
# Use the first device with LED capability as authoritative source
# to avoid inconsistent readings from multiple devices during initialization
for fd, dev in self.iDevices.items():
# Check if device has LED capability (capability 17)
if 17 in dev.capabilities():
return led in dev.leds()
# Fallback to old behavior if no device has LED capability
for fd, dev in self.iDevices.items():
if led in dev.leds():
return True