Ticket #266 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

new feature: send notifications to libnotify daemon on linux

Reported by: guest Owned by: bbangert
Priority: normal Milestone: 1.0
Component: Growl Version: trunk
Severity: normal Keywords: libnotify
Cc: root@…

Description

Hi there.

I was bored and tried to implement a feature I wanted for a few time on hellanzb.

On MacOS you have Growl, and on Linux you have libnotify daemon. If you run a decent distribution and GNOME you probably got it running.

So my patch adds a option to enable notifications to this daemon. If the user enables this option he must have the notify-python bindings installed (my patch check for the module and exits with a nice error if the user doesn't have it).

If everything goes smoothly the user should receive the same notifications as a macos user receives with Growl.

Please send me sugestions about this patch, and if it is already good to apply, go ahead :) the patch is against the svn trunk.

Thank you for your help and keep your good work.

Here's the diffstat:

 Hellanzb/Core.py                      |   14 ++++++++++++++
 Hellanzb/Daemon.py                    |    1 +
 Hellanzb/Log.py                       |   15 +++++++++++++++
 Hellanzb/NZBLeecher/ArticleDecoder.py |    1 +
 Hellanzb/NZBQueue.py                  |    5 +++++
 Hellanzb/PostProcessor.py             |    2 ++
 Hellanzb/PostProcessorUtil.py         |    8 ++++++++
 etc/hellanzb.conf.sample              |    4 ++++

PS - If you need to contact me you can do it by email: root (at) cpan (dot) org

Ruben Fonseca

Attachments

hellanzb_libnotifypatch.patch Download (8.0 KB) - added by guest 4 years ago.
libnotify patch
libnotify.patch Download (8.1 KB) - added by guest 4 years ago.
new libnotify patch

Change History

Changed 4 years ago by guest

libnotify patch

  Changed 4 years ago by pjenvey

This would be great to add

However since your libnotify calling function takes the exact same arguments as growlNotify, the two should really be combined into one parent notification call that dispatches to both functions when appropriate

Maybe by a function simply called Hellanzb.Log.notify

  Changed 4 years ago by guest

I totally agree!

The new patch (forget the first one) is now attached :)

Please forget any mistakes, it is my first real experience with Python :)

Changed 4 years ago by guest

new libnotify patch

follow-up: ↓ 4   Changed 4 years ago by pjenvey

  • status changed from new to closed
  • resolution set to fixed

sweet! thanks for the updated patch. applied in r994

I made a few small changes:

o removed '(Linux)' from the config directive's description in the config file (libnotify can run on other o/ses) o assume False if the config file directive is not defined o avoided 'import pynotify' everytime libnotifyNotify is called o mention 'libnotify' in its failure debug message o changed the libnotify init tag to 'hellanzb' from 'HellaNZB' (since it's lowercase everywhere else in the app)

Let me know if the last change is a problem

in reply to: ↑ 3   Changed 4 years ago by guest

Replying to pjenvey:

I told you I'm so noob at python :) Anyway, I learned a lot! All the small changes you made make perfect sense and the last one works with no problem!

Thank you :)

Note: See TracTickets for help on using tickets.