Skip to content

Commit

Permalink
address comments left by @ErikBjare on #99 ([Feature] Add `exclude_ti…
Browse files Browse the repository at this point in the history
…tles` feature for enhanced window title exclusion);
  • Loading branch information
ellipsis-dev[bot] authored May 8, 2024
1 parent 9ac6fb0 commit 6d0ccfd
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions aw_watcher_window/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
if log_level:
logger.setLevel(logging.__getattribute__(log_level.upper()))


def kill_process(pid):
logger.info("Killing process {}".format(pid))
try:
os.kill(pid, signal.SIGTERM)
except ProcessLookupError:
logger.info("Process {} already dead".format(pid))


def main():
args = parse_args()

Expand Down Expand Up @@ -93,10 +91,9 @@ def main():
poll_time=args.poll_time,
strategy=args.strategy,
exclude_title=args.exclude_title,
exclude_titles=[re.compile(re.escape(title), re.IGNORECASE) for title in args.exclude_titles]
exclude_titles=[try: re.compile(title, re.IGNORECASE) except re.error: re.compile(re.escape(title), re.IGNORECASE) for title in args.exclude_titles]

Check failure

Code scanning / CodeQL

Syntax error Error

Syntax Error (in Python 3).
)


def heartbeat_loop(client, bucket_id, poll_time, strategy, exclude_title=False, exclude_titles=[]):
while True:
if os.getppid() == 1:
Expand Down Expand Up @@ -147,4 +144,4 @@ def heartbeat_loop(client, bucket_id, poll_time, strategy, exclude_title=False,
bucket_id, current_window_event, pulsetime=poll_time + 1.0, queued=True
)

sleep(poll_time)
sleep(poll_time)

0 comments on commit 6d0ccfd

Please sign in to comment.