diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index db085d50d..370eb38f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,6 +32,9 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Install poetry uses: snok/install-poetry@v1 diff --git a/openadapt/privacy/__init__.py b/openadapt/privacy/__init__.py index e69de29bb..d58acf990 100644 --- a/openadapt/privacy/__init__.py +++ b/openadapt/privacy/__init__.py @@ -0,0 +1,4 @@ +"""Package for the Privacy API. + +Module: __init__.py +""" diff --git a/openadapt/privacy/providers/__init__.py b/openadapt/privacy/providers/__init__.py index e69de29bb..e5e493964 100644 --- a/openadapt/privacy/providers/__init__.py +++ b/openadapt/privacy/providers/__init__.py @@ -0,0 +1,4 @@ +"""Package for the Providers. + +Module: __init__.py +""" diff --git a/openadapt/productivity.py b/openadapt/productivity.py index a8dad76db..63fd87b9f 100644 --- a/openadapt/productivity.py +++ b/openadapt/productivity.py @@ -4,14 +4,14 @@ Usage: - $ python openadapt/productivity.py" + $ python -m openadapt.productivity """ from pprint import pformat from threading import Timer +from typing import Optional, Tuple import os import string -from typing import Optional, Tuple from bokeh.io import output_file, show from bokeh.layouts import layout, row @@ -19,11 +19,8 @@ from loguru import logger from openadapt.crud import get_latest_recording, get_window_events - -from openadapt.events import ( - get_events, -) - +from openadapt.events import get_events +from openadapt.models import ActionEvent, WindowEvent from openadapt.utils import ( configure_logging, display_event, @@ -31,17 +28,9 @@ row2dict, rows2dicts, ) - from openadapt.visualize import IMG_WIDTH_PCT, MAX_EVENTS, dict2html -from openadapt.models import ( - ActionEvent, - Screenshot, - WindowEvent, -) - -CSS = string.Template( - """ +CSS = string.Template(""" table { outline: 1px solid black; } @@ -62,8 +51,7 @@ .screenshot:active img:nth-child(1) { display: block; } -""" -).substitute( +""").substitute( IMG_WIDTH_PCT=IMG_WIDTH_PCT, ) @@ -178,7 +166,7 @@ def find_num_tasks( action_events: list[ActionEvent], start: ActionEvent, length: int, - task: Optional[ActionEvent] = None, + task: Optional[list[ActionEvent]] = None, ) -> Tuple[list[ActionEvent], int, float]: """ Given a list of ActionEvents, the start of a repeating task, the length of the task, and @@ -586,13 +574,11 @@ def calculate_productivity(): """, ), - Div( - text=f""" + Div(text=f""" {dict2html(window_info)}
- """ - ), + """), ), ] ) @@ -639,13 +625,11 @@ def calculate_productivity(): """, ), - Div( - text=f""" + Div(text=f""" {dict2html(window_info)}
- """ - ), + """), ), ] )