Ticket #121 (defect)

Opened 3 years ago

Last modified 3 years ago

'attach_to_status_icon' doesn't work

Status: new

Reported by: infinito Assigned to: chipx86
Priority: high Milestone:
Component: notify-python Version:
Severity: normal Keywords:
Cc: code@infinicode.org D-BUS Version:
Patch Included: 0 OS/Distro Version: Ubuntu Feisty

'attach_to_status_icon' doesn't work on notify-python-0.1.1

When trying to use it, it says:

AttributeError: ‘pynotify.Notification’ object has no attribute ‘attach_to_status_icon’

==> Example code:

#! /usr/bin/python
# -*- coding: UTF-8 -*-

import pygtk
pygtk.require("2.0")
import gtk
import pynotify

icon = gtk.StatusIcon()
icon.set_from_file('icon.png')

pynotify.init('example')
n = pynotify.Notification('foo', 'bar')
n.attach_to_status_icon(icon)
n.show()

gtk.main()

==> Error reported:

Traceback (most recent call last):
  File "icon.py", line 14, in ?
    n.attach_to_status_icon(icon)
AttributeError: 'pynotify.Notification' object has no attribute 'attach_to_status_icon'

Attachments

attach_to_status_icon.patch (1.6 kB) - added by infinito on 03/01/07 03:48:18.
Patch to enable attach_to_status_icon

Change History

02/19/07 04:18:03: Modified by infinito

  • cc set to code@infinicode.org.

03/01/07 03:48:18: Modified by infinito

  • attachment attach_to_status_icon.patch added.

Patch to enable attach_to_status_icon

03/01/07 05:03:42: Modified by infinito

  • priority changed from normal to high.

The attached patch fixes this bug. Please apply to svn.

08/03/07 10:31:29: Modified by martin.pitt@ubuntu.com

Note that a source patch is not necessary at all. The reason is simply that src/pynotify.c does not get rebuilt properly. When deleting the file, it gets regenerated properly and attach_to_status_icon() works. This is the fix I did in Ubuntu.