File tree Expand file tree Collapse file tree 4 files changed +742
-398
lines changed
Expand file tree Collapse file tree 4 files changed +742
-398
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,14 @@ jobs:
1313 strategy :
1414 fail-fast : false
1515 matrix :
16- os : [ubuntu-20.04 , windows-latest, macOS-11 ]
17- python_version : [3.11 ]
16+ os : [ubuntu-latest , windows-latest, macOS-latest ]
17+ python_version : [3.13 ]
1818 steps :
19- - uses : actions/checkout@v2
19+ - uses : actions/checkout@v4
2020 with :
2121 submodules : ' recursive'
2222 - name : Set up Python
23- uses : actions/setup-python@v4
23+ uses : actions/setup-python@v5
2424 with :
2525 python-version : ${{ matrix.python_version }}
2626 - name : Create virtualenv
3030 - name : Install dependencies
3131 shell : bash
3232 run : |
33- pip install poetry==1.3.2 # due to: https://github.com/python-poetry/poetry/issues/7611
33+ pip install poetry
3434 source venv/bin/activate || source venv/Scripts/activate
3535 poetry install
3636 - name : Run tests
Original file line number Diff line number Diff line change 33and send notifications to the user on predefined conditions.
44"""
55
6+ import asyncio
67import logging
78import shutil
89import subprocess
2324import aw_client .queries
2425import click
2526from aw_core .log import setup_logging
26- from desktop_notifier import DesktopNotifier
27+ from desktop_notifier import DesktopNotifier , Icon
2728from typing_extensions import TypeAlias
2829
2930logger = logging .getLogger (__name__ )
@@ -161,10 +162,19 @@ def notify(title: str, msg: str):
161162 if notifier is None :
162163 notifier = DesktopNotifier (
163164 app_name = "AW" ,
164- app_icon = f"file://{ icon_path } " ,
165+ app_icon = Icon ( uri = f"file://{ icon_path } " ) ,
165166 notification_limit = 10 ,
166167 )
167- notifier .send_sync (title = title , message = msg )
168+
169+ # Get or create event loop
170+ try :
171+ loop = asyncio .get_running_loop ()
172+ except RuntimeError :
173+ loop = asyncio .new_event_loop ()
174+ asyncio .set_event_loop (loop )
175+
176+ # Send notification
177+ loop .run_until_complete (notifier .send (title = title , message = msg ))
168178 return
169179 except Exception as e :
170180 logger .info (f"desktop-notifier not used: { e } " )
You can’t perform that action at this time.
0 commit comments