Author: dmeyer
Date: Sat Mar 1 05:03:15 2008
New Revision: 3141
Log:
add glib test
Added:
trunk/base/test/glib.py
Added: trunk/base/test/glib.py
==============================================================================
--- (empty file)
+++ trunk/base/test/glib.py Sat Mar 1 05:03:15 2008
@@ -0,0 +1,31 @@
+import kaa
+
+class Test():
+
+ @kaa.threaded(kaa.GOBJECT)
+ @kaa.synchronized()
+ def foo(self):
+ import time
+ time.sleep(0.4)
+ return kaa.is_mainthread()
+
+ @kaa.coroutine()
+ def test(self):
+ r = yield self.foo()
+ print 'foo', kaa.is_mainthread(), r
+
+ @kaa.synchronized()
+ def has_to_wait(self):
+ print 'go'
+
+if 1:
+ kaa.main.select_notifier('generic')
+ kaa.gobject_set_threaded()
+else:
+ kaa.main.select_notifier('gtk')
+
+t = Test()
+kaa.OneShotTimer(t.test).start(0.1)
+kaa.OneShotTimer(t.has_to_wait).start(0.2)
+kaa.main.run()
+print 'done'
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog