From 2674259c9b1e7e216266d75dcee5d8fe51f900bf Mon Sep 17 00:00:00 2001 From: wlechell Date: Sun, 16 Jul 2017 19:32:13 -0400 Subject: [PATCH 1/4] modified makefile for local install --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9f75fb0..70d1a54 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: build build: - pip3 install . --process-dependency-links + pip3 install . --process-dependency-links --user test: python3 -c "import aw_watcher_window" From 72d53870e0fb7b0a56020467312d7e28802627ce Mon Sep 17 00:00:00 2001 From: wlechell Date: Tue, 18 Jul 2017 17:01:36 -0400 Subject: [PATCH 2/4] watcher die along with parent aw-qt process --- aw_watcher_window/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aw_watcher_window/main.py b/aw_watcher_window/main.py index 2e3739a..96f879e 100644 --- a/aw_watcher_window/main.py +++ b/aw_watcher_window/main.py @@ -39,7 +39,7 @@ def main(): bucket_id = "{}_{}".format(client.client_name, client.client_hostname) event_type = "currentwindow" client.create_bucket(bucket_id, event_type, queued=True) - + logger.info("aw-watcher-window has started") with client: heartbeat_loop(client, bucket_id, poll_time=args.poll_time, exclude_title=args.exclude_title) @@ -54,9 +54,12 @@ def parse_args(default_poll_time: float): parser.add_argument("--poll-time", dest="poll_time", type=float, default=default_poll_time) return parser.parse_args() - def heartbeat_loop(client, bucket_id, poll_time, exclude_title=False): while True: + if os.getppid() == 1: + logger.info("window-watcher stopped because parent process died") + break + try: current_window = get_current_window() logger.debug(current_window) From 4db2d242683dd83e599bd472655dd6f2e85a43ca Mon Sep 17 00:00:00 2001 From: wlechell Date: Tue, 18 Jul 2017 17:10:15 -0400 Subject: [PATCH 3/4] undo --user local install --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 70d1a54..9f75fb0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: build build: - pip3 install . --process-dependency-links --user + pip3 install . --process-dependency-links test: python3 -c "import aw_watcher_window" From 75bf99eaf78c695a7e0f1b82df172c4680f15380 Mon Sep 17 00:00:00 2001 From: wlechell Date: Tue, 18 Jul 2017 17:11:18 -0400 Subject: [PATCH 4/4] undo blank lines --- aw_watcher_window/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aw_watcher_window/main.py b/aw_watcher_window/main.py index 96f879e..e0356bc 100644 --- a/aw_watcher_window/main.py +++ b/aw_watcher_window/main.py @@ -40,6 +40,7 @@ def main(): event_type = "currentwindow" client.create_bucket(bucket_id, event_type, queued=True) + logger.info("aw-watcher-window has started") with client: heartbeat_loop(client, bucket_id, poll_time=args.poll_time, exclude_title=args.exclude_title) @@ -54,6 +55,7 @@ def parse_args(default_poll_time: float): parser.add_argument("--poll-time", dest="poll_time", type=float, default=default_poll_time) return parser.parse_args() + def heartbeat_loop(client, bucket_id, poll_time, exclude_title=False): while True: if os.getppid() == 1: