Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/aw_watcher_input/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
from datetime import datetime, timezone
from time import sleep
from typing import Optional

import aw_client
import click
Expand All @@ -11,11 +12,17 @@


@click.command()
@click.option("--host", default=None, help="Hostname of the aw-server to connect to.")
@click.option(
"--port", default=None, type=int, help="Port of the aw-server to connect to."
)
@click.option("--testing", is_flag=True)
def main(testing: bool):
def main(testing: bool, host: Optional[str], port: Optional[int]):
logging.basicConfig(level=logging.INFO)
logger.info("Starting watcher...")
client = aw_client.ActivityWatchClient("aw-watcher-input", testing=testing)
client = aw_client.ActivityWatchClient(
"aw-watcher-input", testing=testing, host=host, port=port
)
client.wait_for_start()
client.connect()

Expand Down