gevent #287

Merged
Atheros1 merged 19 commits from master into master 2013-07-05 22:59:12 +02:00
Showing only changes of commit 5df22b4181 - Show all commits

View File

@ -2927,7 +2927,22 @@ class UISignaler(QThread):
else:
sys.stderr.write(
'Command sent to UISignaler not recognized: %s\n' % command)
try:
import gevent
except ImportError as ex:
print "cannot find gevent"
else:
def mainloop(app):
while True:
app.processEvents()
while app.hasPendingEvents():
app.processEvents()
gevent.sleep()
gevent.sleep() # don't appear to get here but cooperate again
def testprint():
#print 'this is running'
gevent.spawn_later(1, testprint)
def run():
app = QtGui.QApplication(sys.argv)
@ -2946,5 +2961,8 @@ def run():
myapp.appIndicatorInit(app)
myapp.ubuntuMessagingMenuInit()
myapp.notifierInit()
if gevent is None:
sys.exit(app.exec_())
else:
gevent.joinall([gevent.spawn(testprint), gevent.spawn(mainloop, app)])
print 'done'