Author: tack
Date: Sat Jan 12 17:53:57 2008
New Revision: 2968
Log:
Rename kaa.main.start to kaa.main.run as discussed; add Thread.is_alive
method.
Modified:
trunk/base/src/__init__.py
trunk/base/src/notifier/__init__.py
trunk/base/src/notifier/main.py
trunk/base/src/notifier/thread.py
Modified: trunk/base/src/__init__.py
==============================================================================
--- trunk/base/src/__init__.py (original)
+++ trunk/base/src/__init__.py Sat Jan 12 17:53:57 2008
@@ -48,8 +48,8 @@
def __call__(self):
import logging
log = logging.getLogger('notifier')
- log.warning('Deprecated call to kaa.main(); use kaa.main.start()
instead')
- return kaa.notifier.main.start()
+ log.warning('Deprecated call to kaa.main(); use kaa.main.run()
instead')
+ return kaa.notifier.main.run()
def __getattr__(self, attr):
return getattr(kaa.notifier.main, attr)
Modified: trunk/base/src/notifier/__init__.py
==============================================================================
--- trunk/base/src/notifier/__init__.py (original)
+++ trunk/base/src/notifier/__init__.py Sat Jan 12 17:53:57 2008
@@ -81,7 +81,7 @@
return main.is_running()
init = wrap('init', 'select_notifier')
-loop = wrap('loop', 'start')
+loop = wrap('loop', 'run')
shutdown = wrap('shutdown', 'stop')
step = wrap('step', 'step')
signals = main.signals
Modified: trunk/base/src/notifier/main.py
==============================================================================
--- trunk/base/src/notifier/main.py (original)
+++ trunk/base/src/notifier/main.py Sat Jan 12 17:53:57 2008
@@ -46,7 +46,7 @@
from jobserver import killall as kill_jobserver
from decorators import execute_in_mainloop
-__all__ = [ 'start', 'stop', 'step', 'select_notifier', 'is_running', 'wakeup',
+__all__ = [ 'run', 'stop', 'step', 'select_notifier', 'is_running', 'wakeup',
'set_as_mainthread', 'is_shutting_down' ]
# get logging object
@@ -80,7 +80,7 @@
return notifier.init( module, **options )
-def start():
+def run():
"""
Notifier main loop function. It will loop until an exception
is raised or sys.exit is called.
@@ -181,7 +181,7 @@
def _set_running(status):
"""
Set running status. This function is only for the thread based notifier
- since it does not call start().
+ since it does not call run().
"""
global _running
_running = status
Modified: trunk/base/src/notifier/thread.py
==============================================================================
--- trunk/base/src/notifier/thread.py (original)
+++ trunk/base/src/notifier/thread.py Sat Jan 12 17:53:57 2008
@@ -186,6 +186,14 @@
MainThreadCallback(self._emit_and_join, "exception",
sys.exc_info()[1])()
+ def is_running(self):
+ """
+ Returns True if the thread is running, False otherwise.
+ """
+ # We just wrap isAlive().
+ return self.isAlive()
+
+
def is_mainthread():
"""
Return True if the caller is in the main thread right now.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog