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

TypeError: WindowsNotifier.__init__() got an unexpected keyword argument 'default_application_name' #46

Closed
LucasNiesen opened this issue Sep 28, 2022 · 10 comments · Fixed by #48
Labels
bug Something isn't working Windows

Comments

@LucasNiesen
Copy link

I tried this code but it doen't work.
image

@ms7m ms7m added the bug Something isn't working label Sep 28, 2022
@LucasNiesen
Copy link
Author

Is there a temporary fix for this?

@ms7m
Copy link
Owner

ms7m commented Oct 6, 2022

I'll push out a fix for this, but a quick way to fix this is to use the WindowsNotifier.send_notification method directly. This would only work out if you know your target platform is windows.

@LucasNiesen
Copy link
Author

I'll push out a fix for this, but a quick way to fix this is to use the WindowsNotifier.send_notification method directly. This would only work out if you know your target platform is windows.

But how can i change the name?
image

@ms7m
Copy link
Owner

ms7m commented Oct 6, 2022

You can pass application_name parameter to WindowsNotifier.send_notification with the name you'd like.

@LucasNiesen
Copy link
Author

You can pass application_name parameter to WindowsNotifier.send_notification with the name you'd like.

Like this ?
image

@ms7m
Copy link
Owner

ms7m commented Oct 6, 2022

I'm not near a windows computer to verify but you should be able to do something like this:

from notifypy.os_notifiers.windows import WindowsNotifier

WindowsNotifier().send_notification(
        notification_title="Sample Title",
        notification_subtitle="Sample Subtitle",
        notification_icon="path_to_icon.ico",
        application_name="Goat IM",
        notification_audio="path_to_audio.mp3",
)

lmk if it works out for you.

@LucasNiesen
Copy link
Author

The sound works but i dont see any message on my screen.
image

@ms7m
Copy link
Owner

ms7m commented Oct 6, 2022

Might be an issue with the latest versions of Windows -- I won't be back near my desk until the end of the day. I'll take a look at then.

@ms7m ms7m added the Windows label Oct 6, 2022
@LucasNiesen
Copy link
Author

Might be an issue with the latest versions of Windows -- I won't be back near my desk until the end of the day. I'll take a look at then.

So i tried it on win 10 21H2 and win 11 21H2 but it doesn't work on both.

@mniesen
Copy link

mniesen commented Oct 8, 2022

I tried this code but it doen't work. image

Changing default_application_name to default_notification_application_name works for me after running function your_function.

Code looks like:

from notifypy import Notify

notification = Notify(
    default_notification_title="Function Message",
    default_notification_application_name="Great Application",
    default_notification_icon="test.ico"
)

def your_function():
  # stuff happening here.
  notification.message = "Function Result"
  notification.send()

your_function()

In the README.md file the example used default_application_name, this give me an error as well.

@ms7m ms7m closed this as completed in #48 Dec 5, 2022
ms7m added a commit that referenced this issue Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants