Gobject

Eduardo Matus ematus at gmail.com
Fri Sep 21 22:41:18 EDT 2007


hi all... I'm trying to get a event when a pipe of a process is no longer
receiving data, in this case a EOF...
the process start with no problems... but... the gobject_io_add_watch does
not trigger the test method when the file in mplayer has finish... any
ideas??
Thks :)

the codes is this (the relevant part):

import gobject, sys,os

<python-list at python.org>    def play(self,opciones ,target):
        mpc = "mplayer -slave -quiet \"" + target + "\" 2>/dev/null"
        self.pin, self.pout = os.popen2(mpc)  #open pipe
        self.startEofHandler()

    def startEofHandler(self):
        self.eofHandler = gobject.io_add_watch(self.pout, gobject.IO_HUP,
self.test)


    def test(self,source,condition):
        print 'Something happend!!'
        print source
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070921/e9deb980/attachment.html>


More information about the Python-list mailing list