Some fixes to pep8 stuff.
This commit is contained in:
@ -20,7 +20,8 @@ class command:
|
||||
|
||||
def get_description(self):
|
||||
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):
|
||||
|
@ -20,7 +20,8 @@ class command:
|
||||
|
||||
def get_description(self):
|
||||
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):
|
||||
|
@ -82,7 +82,8 @@ class command:
|
||||
else:
|
||||
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,
|
||||
)
|
||||
|
@ -20,7 +20,8 @@ class command:
|
||||
|
||||
def get_description(self):
|
||||
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):
|
||||
|
@ -131,7 +131,10 @@ class command:
|
||||
|
||||
# Pattern 4: Generic activity indicators (Loading..., Working..., etc.)
|
||||
activity_pattern = re.search(
|
||||
r"(loading|processing|working|installing|downloading|compiling|building).*\.{2,}",
|
||||
(
|
||||
r"(loading|processing|working|installing|downloading|"
|
||||
r"compiling|building).*\.{2,}"
|
||||
),
|
||||
text,
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
@ -31,14 +31,21 @@ class command:
|
||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||
if table_info:
|
||||
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:
|
||||
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_end = column_start + len(cell_content)
|
||||
|
||||
# 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
|
||||
|
||||
(
|
||||
|
@ -47,10 +47,14 @@ class command:
|
||||
)
|
||||
if is_table_mode:
|
||||
# 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:
|
||||
# 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(
|
||||
output_text, interrupt=True, flush=False
|
||||
)
|
||||
|
@ -31,9 +31,13 @@ class command:
|
||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||
if table_info:
|
||||
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:
|
||||
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_end = column_start + len(cell_content)
|
||||
|
||||
@ -48,7 +52,9 @@ class command:
|
||||
flush=False,
|
||||
)
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("end of cell"), interrupt=False, sound_icon="EndOfLine"
|
||||
_("end of cell"),
|
||||
interrupt=False,
|
||||
sound_icon="EndOfLine"
|
||||
)
|
||||
return
|
||||
|
||||
@ -56,7 +62,9 @@ class command:
|
||||
relative_pos = cursor_pos["x"] - column_start
|
||||
if relative_pos < len(cell_content) - 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
|
||||
if new_relative_pos < len(cell_content):
|
||||
|
@ -30,7 +30,9 @@ class command:
|
||||
debug.DebugLevel.INFO
|
||||
)
|
||||
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"):
|
||||
# Stay on current cell and play end of line sound
|
||||
current_info = table_info["current_info"]
|
||||
@ -41,11 +43,15 @@ class command:
|
||||
)
|
||||
# Play end of line sound
|
||||
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:
|
||||
# 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(
|
||||
output_text, interrupt=True, flush=False
|
||||
)
|
||||
|
@ -35,22 +35,31 @@ class command:
|
||||
table_info = self.env["runtime"]["TableManager"].get_current_table_cell_info()
|
||||
if table_info:
|
||||
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:
|
||||
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
|
||||
if cursor_pos["x"] <= column_start:
|
||||
# At cell boundary - announce start and don't move
|
||||
char_utils.present_char_for_review(
|
||||
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,
|
||||
announce_capital=True,
|
||||
flush=False,
|
||||
)
|
||||
self.env["runtime"]["OutputManager"].present_text(
|
||||
_("start of cell"), interrupt=False, sound_icon="StartOfLine"
|
||||
_("start of cell"),
|
||||
interrupt=False,
|
||||
sound_icon="StartOfLine"
|
||||
)
|
||||
return
|
||||
|
||||
@ -59,7 +68,9 @@ class command:
|
||||
relative_pos = cursor_pos["x"] - column_start
|
||||
if relative_pos > 0:
|
||||
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
|
||||
if new_relative_pos < len(cell_content):
|
||||
|
@ -30,22 +30,30 @@ class command:
|
||||
debug.DebugLevel.INFO
|
||||
)
|
||||
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"):
|
||||
# Stay on current cell at beginning of line
|
||||
current_info = table_info["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(
|
||||
output_text, interrupt=True, flush=False
|
||||
)
|
||||
# Play start of line sound
|
||||
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:
|
||||
# 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(
|
||||
output_text, interrupt=True, flush=False
|
||||
)
|
||||
|
@ -19,7 +19,8 @@ class command:
|
||||
|
||||
def get_description(self):
|
||||
return _(
|
||||
"Enables or disables automatic reading of time after specified intervals"
|
||||
"Enables or disables automatic reading of time after specified "
|
||||
"intervals"
|
||||
)
|
||||
|
||||
def run(self):
|
||||
|
@ -31,7 +31,8 @@ class command:
|
||||
table_mode = self.env["runtime"]["TableManager"].is_table_mode()
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
|
@ -29,7 +29,9 @@ class command:
|
||||
if self.env["runtime"]["HelpManager"].is_tutorial_mode():
|
||||
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,
|
||||
)
|
||||
|
@ -30,7 +30,8 @@ class command:
|
||||
return
|
||||
if self.env["runtime"]["AttributeManager"].is_attribute_change():
|
||||
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
|
||||
if (
|
||||
self.env["screen"]["new_cursor"]["x"]
|
||||
|
Reference in New Issue
Block a user