Author: dmeyer
Date: Thu Nov 2 17:47:18 2006
New Revision: 1965
Modified:
trunk/popcorn/src/utils/ipc.py
trunk/popcorn/test/baloo.py
trunk/popcorn/test/play.py
Log:
improve child logger
Modified: trunk/popcorn/src/utils/ipc.py
==============================================================================
--- trunk/popcorn/src/utils/ipc.py (original)
+++ trunk/popcorn/src/utils/ipc.py Thu Nov 2 17:47:18 2006
@@ -42,7 +42,7 @@
from kaa.weakref import weakref
# get logging object
-log = logging.getLogger('player.child')
+log = logging.getLogger('popcorn.child')
class ChildCommand(object):
"""
@@ -70,6 +70,7 @@
self._child = kaa.notifier.Process([sys.executable, '-u'] + list(args))
self._child.signals["stdout"].connect_weak(self._handle_line)
self._child.signals["stderr"].connect_weak(self._handle_line)
+ self._name = os.path.basename(os.path.dirname(args[0]))
def start(self):
@@ -89,7 +90,7 @@
getattr(self._parent, "_child_" + command)(*args, **kwargs)
else:
# same debug
- log.info("CHILD[%d]: %s", self._child.child.pid, line)
+ log.info("[%s-%d] %s", self._name, self._child.child.pid, line)
def __getattr__(self, attr):
Modified: trunk/popcorn/test/baloo.py
==============================================================================
--- trunk/popcorn/test/baloo.py (original)
+++ trunk/popcorn/test/baloo.py Thu Nov 2 17:47:18 2006
@@ -96,8 +96,8 @@
if not len(self.search):
return False
self.current = self.search[index]
- self.player.open(self.current.filename)
- self.player.play(video=False)
+ self.player.open(self.current.filename, player='xine')
+ self.player.play()
for t in ('title', 'artist', 'album'):
label = self.xml.get_widget(t)
value = self.current.get(t) or ''
Modified: trunk/popcorn/test/play.py
==============================================================================
--- trunk/popcorn/test/play.py (original)
+++ trunk/popcorn/test/play.py Thu Nov 2 17:47:18 2006
@@ -6,7 +6,8 @@
import kaa.popcorn
import kaa.input.stdin
-logging.getLogger('player').setLevel(logging.INFO)
+logging.getLogger('popcorn').setLevel(logging.INFO)
+# logging.getLogger('popcorn.child').setLevel(logging.ERROR)
def print_msg(msg):
@@ -30,10 +31,11 @@
window = kaa.display.X11Window(size = (800,600), title = "kaa.popcorn")
-player = kaa.popcorn.Player(window)
-player.signals["start"].connect_once(window.show)
+player = kaa.popcorn.Player() #window)
+#player.signals["start"].connect_once(window.show)
player.signals["start"].connect(print_msg, 'playback started')
player.signals["end"].connect(print_msg, 'playback end')
+player.signals["end"].connect(next, 'xine')
player.signals["failed"].connect(print_msg, 'playback failed')
kaa.signals["stdin_key_press_event"].connect(handle_key, player)
@@ -41,10 +43,11 @@
player.get_window().signals["key_press_event"].connect(handle_key, player)
kaa.notifier.OneShotTimer(next, 'xine').start(0)
+kaa.notifier.OneShotTimer(player.stop).start(1)
def print_pos():
- print '\r', player.get_position(),
- sys.stdout.flush()
+# print '\r', player.get_position(),
+# sys.stdout.flush()
return True
kaa.notifier.Timer(print_pos).start(0.1)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog