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

Use of deprecated pygobject imports? #62

Closed
ff2000 opened this issue Mar 1, 2015 · 4 comments
Closed

Use of deprecated pygobject imports? #62

ff2000 opened this issue Mar 1, 2015 · 4 comments

Comments

@ff2000
Copy link

ff2000 commented Mar 1, 2015

I have issues starting mpDris2.
import glib does not work. The new (?) and recommended way seems to be

from gi.repository import GLib

If I add " as glib" everything works.
Until I enable Bling.notify. It does not find pynotify.
Again, the same game

from gi.repository import Notify as pynotify

And here my python skills (and time ;)) ends:

Traceback (most recent call last):
  File "/usr/bin/mpDris2", line 1224, in <module>
    notification = Notify(params)
  File "/usr/bin/mpDris2", line 764, in __init__
    self._notification = pynotify.Notification("", "", "")
TypeError: GObject.__init__() takes exactly 0 arguments (3 given)

It seems Notify is not backwards compatible.
I am running pygobject-3.14.0 on Gentoo.

@grawity
Copy link
Collaborator

grawity commented Mar 5, 2015

import glib does not work. The new (?) and recommended way seems to be

from gi.repository import GLib

While pygobject 2.x is deprecated, it is still usable and can be installed side-by-side with pygobject 3.x (I think Gentoo calls it "slots"?)

Anyway, mpDris2-git will now use the best available version.

It seems Notify is not backwards compatible.

Yes, the custom pynotify bindings were a bit different from the real libnotify API.

I'll try to port mpDris2 away from pynotify; until then, install dev-python/py-notify.

@grawity
Copy link
Collaborator

grawity commented Mar 5, 2015

Ported to GObject.Notify in git.

@grawity grawity closed this as completed Mar 5, 2015
grawity added a commit that referenced this issue Mar 5, 2015
@ff2000
Copy link
Author

ff2000 commented Mar 5, 2015

Thanks for the fixes!
I already tried py-notify, but it seems to offer yet another API for notifications. There is no pynotify import, you have to import "notify.all" or similar, according to the docs. That's why I thought it's the old way to import notify, just like "glib".
So never mind, everything is going fine now :)

@grawity
Copy link
Collaborator

grawity commented Mar 5, 2015

Ah, it might be dev-python/notify-python in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants