7 def __init__(self, AppName):
10 self.msgbox = pynotify.Notification(self.AppName, self.AppName, "PCR_on.bmp")
11 self.msgbox.set_urgency(pynotify.URGENCY_CRITICAL)
12 self.msgbox.set_timeout(5000)
14 def show_message(self, message):
15 self.msgbox = pynotify.Notification(self.AppName, message)
18 def set_image(self, img):
19 # image = Image.open(img)
20 # image = gtk.gdk.pixbuf_new_from_file(img)
21 # self.msgbox.set_icon_from_pixbuf(self.image2pixbuf(image))
24 def image2pixbuf(self, img):
25 file1 = StringIO.StringIO()
27 img.save(file1, "ppm")
28 contents = file1.getvalue()
31 loader = gtk.gdk.PixbufLoader("pnm")
32 loader.write(contents, len(contents))
34 pixbuf = loader.get_pixbuf()