[Twisted-Python] Question : PyNotify call from twist daemon

bino oetomo bino at indoakses-online.com
Tue Mar 6 03:56:29 EST 2012


Dear All ...

I have a Serial service in my twisted script

Inside my 'class ArduinoReceiver(LineReceiver):' ,
I have a function like :
---START----
     def setdisplay(self, dispmode):
         global mynotify
         self.ntf_title = 'TOMBOL'
         self.ntf_body = 'Coba aja'
         try :
             mynotify.close()
         except :
             pass
         print 'Try to display button notification %s' % (dispmode)
         mynotify = pynotify.Notification(self.ntf_title, self.ntf_body)
         print 'MYNOTIFY ', str(mynotify)

----STOP---


When I try to run my tac file , and do something that will call that 
'setdisplay' function , there is no notification poped-up
But from the log file .. I got
2012-03-06 08:47:51+0000 [-] MYNOTIFY <pynotify.Notification object at 
0x96a5b6c (NotifyNotification at 0x9665d90)>

I made a test using shiped example :
---START---
#!/usr/bin/env python

import pygtk
pygtk.require('2.0')
import pynotify
import sys

if __name__ == '__main__':
     if not pynotify.init("Markup"):
         sys.exit(1)

     n = pynotify.Notification("Summary",
         "Some <b>bold</b>, <u>underlined</u>, <i>italic</i>, " +
         "<a href='http://www.google.com'>linked</a> text")

     if not n.show():
         print "Failed to send notification"
         sys.exit(1)
---STOP----

It work just fine.

My system is : Ubuntu maveric, with just Xorg and OpenBox


Kindly please give me any of your enlightment to fix this problem

Sincerely
-bino-




More information about the Twisted-Python mailing list