Skip to content

Commit

Permalink
Merge branch 'OpenAdaptAI:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KrishPatel13 authored Aug 25, 2023
2 parents 35b839a + 2089e74 commit 18e7648
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions openadapt/privacy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Package for the Privacy API.
Module: __init__.py
"""
4 changes: 4 additions & 0 deletions openadapt/privacy/providers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Package for the Providers.
Module: __init__.py
"""
38 changes: 11 additions & 27 deletions openadapt/productivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,33 @@
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
from bokeh.models.widgets import Div
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,
image2utf8,
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;
}
Expand All @@ -62,8 +51,7 @@
.screenshot:active img:nth-child(1) {
display: block;
}
"""
).substitute(
""").substitute(
IMG_WIDTH_PCT=IMG_WIDTH_PCT,
)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -586,13 +574,11 @@ def calculate_productivity():
</table>
""",
),
Div(
text=f"""
Div(text=f"""
<table>
{dict2html(window_info)}
</table>
"""
),
"""),
),
]
)
Expand Down Expand Up @@ -639,13 +625,11 @@ def calculate_productivity():
</table>
""",
),
Div(
text=f"""
Div(text=f"""
<table>
{dict2html(window_info)}
</table>
"""
),
"""),
),
]
)
Expand Down

0 comments on commit 18e7648

Please sign in to comment.