Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences between Notify and pynotify?

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.

like image 730
Depado Avatar asked Jan 16 '13 13:01

Depado


1 Answers

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.

like image 105
César García Tapia Avatar answered Sep 29 '22 09:09

César García Tapia