Some fixes to pep8 stuff.
This commit is contained in:
@ -20,7 +20,8 @@ class command:
|
|||||||
|
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
return _(
|
return _(
|
||||||
"read line to cursor pos, use review cursor if you are in review mode, otherwhise use text cursor"
|
"read line to cursor pos, use review cursor if you are in review mode, "
|
||||||
|
"otherwhise use text cursor"
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -20,7 +20,8 @@ class command:
|
|||||||
|
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
return _(
|
return _(
|
||||||
"read to end of line, use review cursor if you are in review mode, otherwhise use text cursor"
|
"read to end of line, use review cursor if you are in review mode, "
|
||||||
|
"otherwhise use text cursor"
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -82,7 +82,8 @@ class command:
|
|||||||
else:
|
else:
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_(
|
_(
|
||||||
"failed to export to X clipboard. No available display found."
|
"failed to export to X clipboard. No available display "
|
||||||
|
"found."
|
||||||
),
|
),
|
||||||
interrupt=True,
|
interrupt=True,
|
||||||
)
|
)
|
||||||
|
@ -20,7 +20,8 @@ class command:
|
|||||||
|
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
return _(
|
return _(
|
||||||
"Presents the currently selected text that will be copied to the clipboard"
|
"Presents the currently selected text that will be copied to the "
|
||||||
|
"clipboard"
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -131,7 +131,10 @@ class command:
|
|||||||
|
|
||||||
# Pattern 4: Generic activity indicators (Loading..., Working..., etc.)
|
# Pattern 4: Generic activity indicators (Loading..., Working..., etc.)
|
||||||
activity_pattern = re.search(
|
activity_pattern = re.search(
|
||||||
r"(loading|processing|working|installing|downloading|compiling|building).*\.{2,}",
|
(
|
||||||
|
r"(loading|processing|working|installing|downloading|"
|
||||||
|
r"compiling|building).*\.{2,}"
|
||||||
|
),
|
||||||
text,
|
text,
|
||||||
re.IGNORECASE,
|
re.IGNORECASE,
|
||||||
)
|
)
|
||||||
|
@ -31,14 +31,21 @@ class command:
|
|||||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||||
if table_info:
|
if table_info:
|
||||||
cursor_pos = self.env["screen"]["newCursorReview"]
|
cursor_pos = self.env["screen"]["newCursorReview"]
|
||||||
line_text = self.env["runtime"]["ScreenManager"].get_line_text(cursor_pos["y"])
|
line_text = self.env["runtime"]["ScreenManager"].get_line_text(
|
||||||
|
cursor_pos["y"]
|
||||||
|
)
|
||||||
if line_text:
|
if line_text:
|
||||||
column_start = self.env["runtime"]["TableManager"].get_column_start_position(line_text, table_info["column_index"])
|
column_start = self.env["runtime"]["TableManager"].get_column_start_position(
|
||||||
|
line_text, table_info["column_index"]
|
||||||
|
)
|
||||||
cell_content = table_info["cell_content"]
|
cell_content = table_info["cell_content"]
|
||||||
cell_end = column_start + len(cell_content)
|
cell_end = column_start + len(cell_content)
|
||||||
|
|
||||||
# If cursor is outside the current cell, move to cell start
|
# If cursor is outside the current cell, move to cell start
|
||||||
if cursor_pos["x"] < column_start or cursor_pos["x"] >= cell_end:
|
if (
|
||||||
|
cursor_pos["x"] < column_start or
|
||||||
|
cursor_pos["x"] >= cell_end
|
||||||
|
):
|
||||||
self.env["screen"]["newCursorReview"]["x"] = column_start
|
self.env["screen"]["newCursorReview"]["x"] = column_start
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -47,10 +47,14 @@ class command:
|
|||||||
)
|
)
|
||||||
if is_table_mode:
|
if is_table_mode:
|
||||||
# Get current cell info using internal column tracking
|
# Get current cell info using internal column tracking
|
||||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
table_info = (
|
||||||
|
self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||||
|
)
|
||||||
if table_info:
|
if table_info:
|
||||||
# Announce with table context - cell content first, then header
|
# Announce with table context - cell content first, then header
|
||||||
output_text = f"{table_info['cell_content']} {table_info['column_header']}"
|
output_text = (
|
||||||
|
f"{table_info['cell_content']} {table_info['column_header']}"
|
||||||
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
output_text, interrupt=True, flush=False
|
output_text, interrupt=True, flush=False
|
||||||
)
|
)
|
||||||
|
@ -31,9 +31,13 @@ class command:
|
|||||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||||
if table_info:
|
if table_info:
|
||||||
cursor_pos = self.env["screen"]["newCursorReview"]
|
cursor_pos = self.env["screen"]["newCursorReview"]
|
||||||
line_text = self.env["runtime"]["ScreenManager"].get_line_text(cursor_pos["y"])
|
line_text = self.env["runtime"]["ScreenManager"].get_line_text(
|
||||||
|
cursor_pos["y"]
|
||||||
|
)
|
||||||
if line_text:
|
if line_text:
|
||||||
column_start = self.env["runtime"]["TableManager"].get_column_start_position(line_text, table_info["column_index"])
|
column_start = self.env["runtime"]["TableManager"].get_column_start_position(
|
||||||
|
line_text, table_info["column_index"]
|
||||||
|
)
|
||||||
cell_content = table_info["cell_content"]
|
cell_content = table_info["cell_content"]
|
||||||
cell_end = column_start + len(cell_content)
|
cell_end = column_start + len(cell_content)
|
||||||
|
|
||||||
@ -48,7 +52,9 @@ class command:
|
|||||||
flush=False,
|
flush=False,
|
||||||
)
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_("end of cell"), interrupt=False, sound_icon="EndOfLine"
|
_("end of cell"),
|
||||||
|
interrupt=False,
|
||||||
|
sound_icon="EndOfLine"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -56,7 +62,9 @@ class command:
|
|||||||
relative_pos = cursor_pos["x"] - column_start
|
relative_pos = cursor_pos["x"] - column_start
|
||||||
if relative_pos < len(cell_content) - 1:
|
if relative_pos < len(cell_content) - 1:
|
||||||
new_relative_pos = relative_pos + 1
|
new_relative_pos = relative_pos + 1
|
||||||
self.env["screen"]["newCursorReview"]["x"] = column_start + new_relative_pos
|
self.env["screen"]["newCursorReview"]["x"] = (
|
||||||
|
column_start + new_relative_pos
|
||||||
|
)
|
||||||
|
|
||||||
# Get character at new position
|
# Get character at new position
|
||||||
if new_relative_pos < len(cell_content):
|
if new_relative_pos < len(cell_content):
|
||||||
|
@ -30,7 +30,9 @@ class command:
|
|||||||
debug.DebugLevel.INFO
|
debug.DebugLevel.INFO
|
||||||
)
|
)
|
||||||
if is_table_mode:
|
if is_table_mode:
|
||||||
table_info = self.env["runtime"]["TableManager"].move_to_next_column()
|
table_info = (
|
||||||
|
self.env["runtime"]["TableManager"].move_to_next_column()
|
||||||
|
)
|
||||||
if table_info and table_info.get("at_end"):
|
if table_info and table_info.get("at_end"):
|
||||||
# Stay on current cell and play end of line sound
|
# Stay on current cell and play end of line sound
|
||||||
current_info = table_info["current_info"]
|
current_info = table_info["current_info"]
|
||||||
@ -41,11 +43,15 @@ class command:
|
|||||||
)
|
)
|
||||||
# Play end of line sound
|
# Play end of line sound
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_("end of line"), interrupt=False, sound_icon="EndOfLine"
|
_("end of line"),
|
||||||
|
interrupt=False,
|
||||||
|
sound_icon="EndOfLine"
|
||||||
)
|
)
|
||||||
elif table_info:
|
elif table_info:
|
||||||
# Normal column navigation - announce cell content with column info
|
# Normal column navigation - announce cell content with column info
|
||||||
output_text = f"{table_info['cell_content']} {table_info['column_header']}"
|
output_text = (
|
||||||
|
f"{table_info['cell_content']} {table_info['column_header']}"
|
||||||
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
output_text, interrupt=True, flush=False
|
output_text, interrupt=True, flush=False
|
||||||
)
|
)
|
||||||
|
@ -35,22 +35,31 @@ class command:
|
|||||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||||
if table_info:
|
if table_info:
|
||||||
cursor_pos = self.env["screen"]["newCursorReview"]
|
cursor_pos = self.env["screen"]["newCursorReview"]
|
||||||
line_text = self.env["runtime"]["ScreenManager"].get_line_text(cursor_pos["y"])
|
line_text = self.env["runtime"]["ScreenManager"].get_line_text(
|
||||||
|
cursor_pos["y"]
|
||||||
|
)
|
||||||
if line_text:
|
if line_text:
|
||||||
column_start = self.env["runtime"]["TableManager"].get_column_start_position(line_text, table_info["column_index"])
|
column_start = self.env["runtime"]["TableManager"].get_column_start_position(
|
||||||
|
line_text, table_info["column_index"]
|
||||||
|
)
|
||||||
|
|
||||||
# Check if we're already at the start of the cell
|
# Check if we're already at the start of the cell
|
||||||
if cursor_pos["x"] <= column_start:
|
if cursor_pos["x"] <= column_start:
|
||||||
# At cell boundary - announce start and don't move
|
# At cell boundary - announce start and don't move
|
||||||
char_utils.present_char_for_review(
|
char_utils.present_char_for_review(
|
||||||
self.env,
|
self.env,
|
||||||
table_info["cell_content"][0] if table_info["cell_content"] else "",
|
(
|
||||||
|
table_info["cell_content"][0]
|
||||||
|
if table_info["cell_content"] else ""
|
||||||
|
),
|
||||||
interrupt=True,
|
interrupt=True,
|
||||||
announce_capital=True,
|
announce_capital=True,
|
||||||
flush=False,
|
flush=False,
|
||||||
)
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_("start of cell"), interrupt=False, sound_icon="StartOfLine"
|
_("start of cell"),
|
||||||
|
interrupt=False,
|
||||||
|
sound_icon="StartOfLine"
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -59,7 +68,9 @@ class command:
|
|||||||
relative_pos = cursor_pos["x"] - column_start
|
relative_pos = cursor_pos["x"] - column_start
|
||||||
if relative_pos > 0:
|
if relative_pos > 0:
|
||||||
new_relative_pos = relative_pos - 1
|
new_relative_pos = relative_pos - 1
|
||||||
self.env["screen"]["newCursorReview"]["x"] = column_start + new_relative_pos
|
self.env["screen"]["newCursorReview"]["x"] = (
|
||||||
|
column_start + new_relative_pos
|
||||||
|
)
|
||||||
|
|
||||||
# Get character at new position
|
# Get character at new position
|
||||||
if new_relative_pos < len(cell_content):
|
if new_relative_pos < len(cell_content):
|
||||||
|
@ -30,22 +30,30 @@ class command:
|
|||||||
debug.DebugLevel.INFO
|
debug.DebugLevel.INFO
|
||||||
)
|
)
|
||||||
if is_table_mode:
|
if is_table_mode:
|
||||||
table_info = self.env["runtime"]["TableManager"].move_to_prev_column()
|
table_info = (
|
||||||
|
self.env["runtime"]["TableManager"].move_to_prev_column()
|
||||||
|
)
|
||||||
if table_info and table_info.get("at_start"):
|
if table_info and table_info.get("at_start"):
|
||||||
# Stay on current cell at beginning of line
|
# Stay on current cell at beginning of line
|
||||||
current_info = table_info["current_info"]
|
current_info = table_info["current_info"]
|
||||||
if current_info:
|
if current_info:
|
||||||
output_text = f"{current_info['cell_content']} {current_info['column_header']}"
|
output_text = (
|
||||||
|
f"{current_info['cell_content']} {current_info['column_header']}"
|
||||||
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
output_text, interrupt=True, flush=False
|
output_text, interrupt=True, flush=False
|
||||||
)
|
)
|
||||||
# Play start of line sound
|
# Play start of line sound
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_("start of line"), interrupt=False, sound_icon="StartOfLine"
|
_("start of line"),
|
||||||
|
interrupt=False,
|
||||||
|
sound_icon="StartOfLine"
|
||||||
)
|
)
|
||||||
elif table_info:
|
elif table_info:
|
||||||
# Normal column navigation - announce cell content with column info
|
# Normal column navigation - announce cell content with column info
|
||||||
output_text = f"{table_info['cell_content']} {table_info['column_header']}"
|
output_text = (
|
||||||
|
f"{table_info['cell_content']} {table_info['column_header']}"
|
||||||
|
)
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
output_text, interrupt=True, flush=False
|
output_text, interrupt=True, flush=False
|
||||||
)
|
)
|
||||||
|
@ -19,7 +19,8 @@ class command:
|
|||||||
|
|
||||||
def get_description(self):
|
def get_description(self):
|
||||||
return _(
|
return _(
|
||||||
"Enables or disables automatic reading of time after specified intervals"
|
"Enables or disables automatic reading of time after specified "
|
||||||
|
"intervals"
|
||||||
)
|
)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
@ -31,7 +31,8 @@ class command:
|
|||||||
table_mode = self.env["runtime"]["TableManager"].is_table_mode()
|
table_mode = self.env["runtime"]["TableManager"].is_table_mode()
|
||||||
|
|
||||||
self.env["runtime"]["DebugManager"].write_debug_out(
|
self.env["runtime"]["DebugManager"].write_debug_out(
|
||||||
f"toggle_highlight_tracking: highlight={highlight_mode}, cursor={cursor_mode}, table={table_mode}",
|
f"toggle_highlight_tracking: highlight={highlight_mode}, "
|
||||||
|
f"cursor={cursor_mode}, table={table_mode}",
|
||||||
debug.DebugLevel.INFO
|
debug.DebugLevel.INFO
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -29,7 +29,9 @@ class command:
|
|||||||
if self.env["runtime"]["HelpManager"].is_tutorial_mode():
|
if self.env["runtime"]["HelpManager"].is_tutorial_mode():
|
||||||
self.env["runtime"]["OutputManager"].present_text(
|
self.env["runtime"]["OutputManager"].present_text(
|
||||||
_(
|
_(
|
||||||
"Entering tutorial mode. In this mode commands are described but not executed. You can move through the list of commands with the up and down arrow keys. To Exit tutorial mode press Fenrir+f1."
|
"Entering tutorial mode. In this mode commands are described but not "
|
||||||
|
"executed. You can move through the list of commands with the up and "
|
||||||
|
"down arrow keys. To Exit tutorial mode press Fenrir+f1."
|
||||||
),
|
),
|
||||||
interrupt=True,
|
interrupt=True,
|
||||||
)
|
)
|
||||||
|
@ -30,7 +30,8 @@ class command:
|
|||||||
return
|
return
|
||||||
if self.env["runtime"]["AttributeManager"].is_attribute_change():
|
if self.env["runtime"]["AttributeManager"].is_attribute_change():
|
||||||
return
|
return
|
||||||
# hack for pdmenu and maybe other dialog apps that place the cursor at last cell/row
|
# hack for pdmenu and maybe other dialog apps that place the cursor at
|
||||||
|
# last cell/row
|
||||||
# this is not to be identified as history
|
# this is not to be identified as history
|
||||||
if (
|
if (
|
||||||
self.env["screen"]["new_cursor"]["x"]
|
self.env["screen"]["new_cursor"]["x"]
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
# Fenrir TTY screen reader
|
# Fenrir TTY screen reader
|
||||||
# By Chrys, Storm Dragon, and contributors.
|
# By Chrys, Storm Dragon, and contributors.
|
||||||
|
|
||||||
version = "2025.07.07"
|
version = "2025.07.08"
|
||||||
codeName = "testing"
|
codeName = "testing"
|
||||||
code_name = "testing"
|
code_name = "testing"
|
||||||
|
@ -73,7 +73,8 @@ class driver(remoteDriver):
|
|||||||
rawdata = client_sock.recv(8129)
|
rawdata = client_sock.recv(8129)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.env["runtime"]["DebugManager"].write_debug_out(
|
self.env["runtime"]["DebugManager"].write_debug_out(
|
||||||
"unixDriver watch_dog: Error receiving data from client: "
|
"unixDriver watch_dog: Error receiving data from "
|
||||||
|
"client: "
|
||||||
+ str(e),
|
+ str(e),
|
||||||
debug.DebugLevel.ERROR,
|
debug.DebugLevel.ERROR,
|
||||||
)
|
)
|
||||||
|
@ -66,7 +66,8 @@ class Terminal:
|
|||||||
# Terminal class doesn't have access to env, use fallback
|
# Terminal class doesn't have access to env, use fallback
|
||||||
# logging
|
# logging
|
||||||
print(
|
print(
|
||||||
f"ptyDriver Terminal update_attributes: Error accessing attributes: {e}"
|
f"ptyDriver Terminal update_attributes: Error accessing "
|
||||||
|
f"attributes: {e}"
|
||||||
)
|
)
|
||||||
self.attributes.append([])
|
self.attributes.append([])
|
||||||
|
|
||||||
|
@ -55,7 +55,9 @@ class driver(sound_driver):
|
|||||||
if self.soundFileCommand == "":
|
if self.soundFileCommand == "":
|
||||||
self.soundFileCommand = "play -q -v fenrirVolume fenrirSoundFile"
|
self.soundFileCommand = "play -q -v fenrirVolume fenrirSoundFile"
|
||||||
if self.frequenceCommand == "":
|
if self.frequenceCommand == "":
|
||||||
self.frequenceCommand = "play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence"
|
self.frequenceCommand = (
|
||||||
|
"play -q -v fenrirVolume -n -c1 synth fenrirDuration sine fenrirFrequence"
|
||||||
|
)
|
||||||
self._initialized = True
|
self._initialized = True
|
||||||
|
|
||||||
def play_frequence(
|
def play_frequence(
|
||||||
|
@ -12,9 +12,11 @@ from fenrirscreenreader.core.speechDriver import speech_driver
|
|||||||
class driver(speech_driver):
|
class driver(speech_driver):
|
||||||
"""Speech-dispatcher driver for Fenrir screen reader.
|
"""Speech-dispatcher driver for Fenrir screen reader.
|
||||||
|
|
||||||
This driver provides text-to-speech functionality through speech-dispatcher,
|
This driver provides text-to-speech functionality through
|
||||||
|
speech-dispatcher,
|
||||||
which acts as a common interface to various TTS engines. It supports voice
|
which acts as a common interface to various TTS engines. It supports voice
|
||||||
selection, speech parameters (rate, pitch, volume), and multiple TTS modules.
|
selection, speech parameters (rate, pitch, volume), and multiple TTS
|
||||||
|
modules.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- Dynamic voice switching and parameter adjustment
|
- Dynamic voice switching and parameter adjustment
|
||||||
|
Reference in New Issue
Block a user