Skip to content

Commit

Permalink
Merge commit 'cf49f41b9b3b142eb4a72771d0fa933b236cc1db'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanstout committed Oct 26, 2024
2 parents b13cfbb + cf49f41 commit f91b7db
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
12 changes: 12 additions & 0 deletions .subtrees/gaze-ocr/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.7.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
2 changes: 1 addition & 1 deletion .subtrees/gaze-ocr/gaze_ocr/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from ._gaze_ocr import *
from ._gaze_ocr import * # noqa: F403
19 changes: 12 additions & 7 deletions .subtrees/gaze-ocr/gaze_ocr/_gaze_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,12 @@ def select_text_generator(
self.read_nearby(end_time_range)
else:
self._read_nearby_if_gaze_moved()
filter_function = lambda location: self._is_valid_selection(
start_location.click_coordinates, location[-1].end_coordinates
)

def filter_function(location):
return self._is_valid_selection(
start_location.click_coordinates, location[-1].end_coordinates
)

return (
yield from self.move_text_cursor_to_words_generator(
end_words,
Expand Down Expand Up @@ -804,9 +807,12 @@ def select_matching_text_generator(
self._read_nearby_if_gaze_moved()
screen_contents = self.latest_screen_contents()
if before_prefix_location:
filter_function = lambda location: self._is_valid_selection(
before_prefix_location.click_coordinates, location[-1].end_coordinates
)

def filter_function(location):
return self._is_valid_selection(
before_prefix_location.click_coordinates,
location[-1].end_coordinates,
)
else:
filter_function = None
suffix_matches, suffix_length = screen_contents.find_longest_matching_suffix(
Expand Down Expand Up @@ -1098,7 +1104,6 @@ def _choose_cursor_location(
if disambiguate:
return (yield matches)
else:
screen_contents = self.latest_screen_contents()
return self.find_nearest_cursor_location(matches)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion .subtrees/gaze-ocr/gaze_ocr/eye_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(
from Tobii.Interaction.Framework import GazeTracking

self.is_mock = False
except:
except Exception:
print("Eye tracking libraries are unavailable.")
self.is_mock = True
self._host = None
Expand Down
2 changes: 1 addition & 1 deletion .subtrees/gaze-ocr/gaze_ocr/talon.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dataclasses import dataclass
from typing import Optional

from talon import actions, app, tracking_system, ui
from talon import actions, tracking_system, ui
from talon.track import tobii
from talon.types import Point2d

Expand Down

0 comments on commit f91b7db

Please sign in to comment.