File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2927,7 +2927,22 @@ def run(self):
29272927 else :
29282928 sys .stderr .write (
29292929 'Command sent to UISignaler not recognized: %s\n ' % command )
2930+ try :
2931+ import gevent
2932+ except ImportError as ex :
2933+ print "cannot find gevent"
2934+ else :
2935+ def mainloop (app ):
2936+ while True :
2937+ app .processEvents ()
2938+ while app .hasPendingEvents ():
2939+ app .processEvents ()
2940+ gevent .sleep ()
2941+ gevent .sleep () # don't appear to get here but cooperate again
29302942
2943+ def testprint ():
2944+ #print 'this is running'
2945+ gevent .spawn_later (1 , testprint )
29312946
29322947def run ():
29332948 app = QtGui .QApplication (sys .argv )
@@ -2946,5 +2961,8 @@ def run():
29462961 myapp .appIndicatorInit (app )
29472962 myapp .ubuntuMessagingMenuInit ()
29482963 myapp .notifierInit ()
2949-
2950- sys .exit (app .exec_ ())
2964+ if gevent is None :
2965+ sys .exit (app .exec_ ())
2966+ else :
2967+ gevent .joinall ([gevent .spawn (testprint ), gevent .spawn (mainloop , app )])
2968+ print 'done'
You can’t perform that action at this time.
0 commit comments