5

I'm trying to understand the differences between Notify (python wrapper) and pynotify. For example :

from gi.repository import Notify

and

import pynotify

The code to create a notification looks similar but it seems that I can't import pynotify using python3.3. By the way I can't find a way to create buttons with signal handlers using Notify. Is there a way I can import pynotify in Python3.3 or create buttons with Notify ?
And what is the difference between those two modules ?
I have been searching on internet but it seems that I'm not skilled enough with google u_u
Thanks in advance.

1

1 Answer 1

6

They're two versions of the same stuff: a python binding for libnotify. But import pynotify was the older way of doing it, in the gtk2 times. Since gtk3 included GObject instrospection, you should use the gi.repository thing (The "gi" stands for "Gobject Introspection").

The main difference between the old way and the new GI way is that with GI there's no need to manually build the python (or C#, C++, Vala or whatever) bindings. It's completely automatic, so you can use the new versions without waiting for the binding to be released. It avoid a lot of bugs caused by the manual handling of the bindings.

2
  • Thanks ! :) Is there a doc somewhere for GI ?
    – Depado
    Jan 16, 2013 at 14:33
  • Thanks a lot. I actually didn't know that there was an "add_button" method too. I guess it was ineherited from the old lib.
    – Depado
    Jan 16, 2013 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.