new: activitywatch
This commit is contained in:
parent
fc938a312f
commit
9f72d5906d
1 changed files with 33 additions and 0 deletions
33
my/activitywatch.py
Normal file
33
my/activitywatch.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
'''
|
||||||
|
ActivityWatch data
|
||||||
|
'''
|
||||||
|
|
||||||
|
REQUIRES = [
|
||||||
|
'git+https://github.com/hpi/activitywatch',
|
||||||
|
]
|
||||||
|
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import Sequence, Iterable
|
||||||
|
|
||||||
|
from .core import Paths, get_files
|
||||||
|
|
||||||
|
from my.config import activitywatch as user_config
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class activitywatch(user_config):
|
||||||
|
# paths[s]/glob to the exported JSON data
|
||||||
|
export_path: Paths
|
||||||
|
|
||||||
|
|
||||||
|
def inputs() -> Sequence[Path]:
|
||||||
|
return get_files(activitywatch.export_path)
|
||||||
|
|
||||||
|
|
||||||
|
import activitywatch.dal as dal
|
||||||
|
|
||||||
|
|
||||||
|
def windowEvents():
|
||||||
|
_dal = dal.DAL(inputs())
|
||||||
|
yield from _dal.events('window')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue