Author: dmeyer
Date: Fri Dec 7 12:10:57 2007
New Revision: 2911
Log:
realize kaa.notifier.loop by using nf_wrapper.step
Modified:
trunk/base/src/notifier/__init__.py
trunk/base/src/notifier/nf_wrapper.py
Modified: trunk/base/src/notifier/__init__.py
==============================================================================
--- trunk/base/src/notifier/__init__.py (original)
+++ trunk/base/src/notifier/__init__.py Fri Dec 7 12:10:57 2007
@@ -125,7 +125,8 @@
set_current_as_mainthread()
try:
- notifier.loop()
+ while True:
+ notifier.step()
except (KeyboardInterrupt, SystemExit):
try:
# This looks stupid, I know that. The problem is that if we have
Modified: trunk/base/src/notifier/nf_wrapper.py
==============================================================================
--- trunk/base/src/notifier/nf_wrapper.py (original)
+++ trunk/base/src/notifier/nf_wrapper.py Fri Dec 7 12:10:57 2007
@@ -119,7 +119,6 @@
dispatcher_add = _Wrapper('dispatcher_add')
dispatcher_remove = _Wrapper('dispatcher_remove')
-loop = _Wrapper('loop')
step = _Wrapper('step')
timer_remove = _Wrapper('timer_remove')
timer_add = _Wrapper('timer_add')
@@ -145,13 +144,13 @@
global timer_remove
global socket_remove
global dispatcher_remove
- global loop, step
+ global step
global nf_socket_remove
global nf_socket_add
global nf_conditions
- if not isinstance(loop, _Wrapper):
- raise RuntimeError('notifier loop already running')
+ if not isinstance(timer_add, _Wrapper):
+ raise RuntimeError('notifier already initialized')
if not 'recursive_depth' in options:
# default value of 2 is not enough when using async yield stuff
@@ -163,17 +162,17 @@
raise ImportError()
import notifier
if notifier.loop:
- raise RuntimeError('pynotifier loop already running')
+ raise RuntimeError('pynotifier already initialized')
except ImportError:
# use our own copy of pynotifier
import pynotifier as notifier
- # find a good main loop
+ # find a good main notifier implementation
if not module:
module = 'generic'
if sys.modules.has_key('gtk'):
# The gtk module is loaded, this means that we will hook
- # ourself into the gtk main loop
+ # ourself into the gtk notifier
module = 'gtk'
if not module in ( 'generic', 'gtk'):
@@ -199,7 +198,6 @@
dispatcher_add = notifier.dispatcher_add
dispatcher_remove = notifier.dispatcher_remove
- loop = notifier.loop
step = notifier.step
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog