Skip to content

Commit

Permalink
chore: update dependencies (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
BelKed authored Feb 21, 2025
1 parent 092337a commit cdd67da
Show file tree
Hide file tree
Showing 4 changed files with 742 additions and 398 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macOS-11]
python_version: [3.11]
os: [ubuntu-latest, windows-latest, macOS-latest]
python_version: [3.13]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Create virtualenv
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
shell: bash
run: |
pip install poetry==1.3.2 # due to: https://github.com/python-poetry/poetry/issues/7611
pip install poetry
source venv/bin/activate || source venv/Scripts/activate
poetry install
- name: Run tests
Expand Down
16 changes: 13 additions & 3 deletions aw_notify/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
and send notifications to the user on predefined conditions.
"""

import asyncio
import logging
import shutil
import subprocess
Expand All @@ -23,7 +24,7 @@
import aw_client.queries
import click
from aw_core.log import setup_logging
from desktop_notifier import DesktopNotifier
from desktop_notifier import DesktopNotifier, Icon
from typing_extensions import TypeAlias

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -161,10 +162,19 @@ def notify(title: str, msg: str):
if notifier is None:
notifier = DesktopNotifier(
app_name="AW",
app_icon=f"file://{icon_path}",
app_icon=Icon(uri=f"file://{icon_path}"),
notification_limit=10,
)
notifier.send_sync(title=title, message=msg)

# Get or create event loop
try:
loop = asyncio.get_running_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

# Send notification
loop.run_until_complete(notifier.send(title=title, message=msg))
return
except Exception as e:
logger.info(f"desktop-notifier not used: {e}")
Expand Down
Loading

0 comments on commit cdd67da

Please sign in to comment.