python - Pynotify runs fine interactively, but crashes when run programmatically (on Fedora 13) -
i attempting use pynotify small project, having strange problem on fedora 13 machine. appears when pynotify run programmatically crashes when show() called - however if type line myself runs fine! have tested on ubuntu box, runs absolutely fine.
my testing code is:
import pynotify pynotify.init('somename') n = pynotify.notification("summary", "body") n.show() and results of running this:
$ python -i test.py traceback (most recent call last): file "test.py", line 5, in <module> n.show() glib.gerror: unable connect server >>> n.show() true >>> so, have ideas may cause sort of behaviour? unfortunately fedora environment 1 have little control over, solutions requiring root access/etc not work. can try installing pynotify locally, however, if needed. help.
since owen has not accepted offer take answer, here solution worked me. note have no idea why works (other vague guesses), , don't make sort of guarantees whether solution or not, maybe if ever in odd position help.
if execute n.show() twice, run second time. therefore, in order avoid setting 2 notifications on system pynotify work correctly, have used following:
import pynotify pynotify.init('somename') n = pynotify.notification("summary", "body") try: n.show() except: n.show() note of course small example has flaws, least of outcome if there actual problem pynotify thrown on both n.show()s - merely minimum working example.
Comments
Post a Comment