Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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