Skip to content

Commit

Permalink
feat(openadapt.record): implemented notifications on record (#510)
Browse files Browse the repository at this point in the history
* implemented notifications on record

fixed deprecated/visualize

* fix import
  • Loading branch information
0dm authored Nov 10, 2023
1 parent f5a22fb commit 22db2dc
Show file tree
Hide file tree
Showing 5 changed files with 1,899 additions and 1,848 deletions.
2 changes: 1 addition & 1 deletion openadapt/app/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from openadapt.app.objects.local_file_picker import LocalFilePicker
from openadapt.app.util import get_scrub, set_dark, set_scrub, sync_switch
from openadapt.crud import new_session
from openadapt.db.crud import new_session

record_proc = None

Expand Down
2 changes: 1 addition & 1 deletion openadapt/app/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from openadapt.app.cards import quick_record, stop_record
from openadapt.app.main import FPATH, start
from openadapt.crud import get_all_recordings
from openadapt.db.crud import get_all_recordings
from openadapt.extensions.thread import Thread as oaThread
from openadapt.models import Recording
from openadapt.replay import replay
Expand Down
2 changes: 1 addition & 1 deletion openadapt/deprecated/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tqdm import tqdm

from openadapt import config
from openadapt.crud import get_latest_recording
from openadapt.db.crud import get_latest_recording
from openadapt.events import get_events
from openadapt.models import Recording
from openadapt.privacy.providers.presidio import PresidioScrubbingProvider
Expand Down
4 changes: 4 additions & 0 deletions openadapt/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import tracemalloc

from loguru import logger
from notifypy import Notify
from oa_pynput import keyboard, mouse
from pympler import tracker
from tqdm import tqdm
Expand Down Expand Up @@ -180,6 +181,7 @@ def process_events(
"""
utils.set_start_time(recording_timestamp)
logger.info("Starting")
Notify("Status", "Starting recording...", "OpenAdapt").send()

prev_event = None
prev_screen_event = None
Expand Down Expand Up @@ -238,6 +240,7 @@ def process_events(
del prev_event
prev_event = event
logger.info("Done")
Notify("Status", "Writing to database...", "OpenAdapt").send()


def write_action_event(
Expand Down Expand Up @@ -345,6 +348,7 @@ def write_events(

if progress is not None:
progress.close()
Notify("Status", "Recording complete.", "OpenAdapt").send()

logger.info(f"{event_type=} done")

Expand Down
Loading

0 comments on commit 22db2dc

Please sign in to comment.