/usr/share/doc/python-notify/examples/test-image.py is in python-notify 0.1.1-3ubuntu2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import pynotify
import sys
import gtk
import os
if __name__ == '__main__':
if not pynotify.init("Images Test"):
sys.exit(1)
# Stock icon
n = pynotify.Notification("Icon Test", "Testing stock icon",
"stock_samples")
if not n.show():
print "Failed to send notification"
sys.exit(1)
# Image URI
uri = "file://" + os.path.abspath(os.path.curdir) + "/applet-critical.png"
print "Sending " + uri
n = pynotify.Notification("Alert!", "Testing URI icons", uri)
if not n.show():
print "Failed to send notification"
sys.exit(1)
# Raw image
n = pynotify.Notification("Raw image test",
"Testing sending raw pixbufs")
helper = gtk.Button()
icon = helper.render_icon(gtk.STOCK_DIALOG_QUESTION, gtk.ICON_SIZE_DIALOG)
n.set_icon_from_pixbuf(icon)
if not n.show():
print "Failed to send notification"
sys.exit(1)
|