On Wed, 28 Mar 2007 19:56:51 +0200, Florent THIERY <ft...@gm...>
wrote:
> Hi
>
> I played a little with the alarm_clock software: i changed it a little
> bit so that the wav file selection becomes a .sh file selection,
> executed using
>
> tux.sys.shell_free("sh %s "%(self.sh_filename))
>
> My sample script contains:
>
> mpg321 -o esd http://85.21.79.5:8040/
>
> ... which is a webradio
>
> It seems to me the launched apps (using shell_free) are not considered
> as child processes... How can i stop/locate the launched processes?
Normally it should be, but why do you use 'sh' before your command?
Doesn't work here when I do that.
Here's a simple test I did:
david@david-laptop:~/tmp$ cat test.py
#!/usr/bin/python
import sys
sys.path.append('/opt/tuxdroid/api/python')
from tux import *
tux.sys.shell_free("ps -ef | grep test")
tux.sys.wait(1)
tux.disconnect_from_daemon()
david@david-laptop:~/tmp$ ./test.py
---------------------------------------------------------------
TUXDROID PYTHON API 0.1.2
---------------------------------------------------------------
david 2777 15600 7 14:59 pts/0 00:00:00 /usr/bin/python ./test.py
david 2787 2777 0 14:59 pts/0 00:00:00 sh -c ps -ef | grep test
david 2789 2787 0 14:59 pts/0 00:00:00 grep test
>
> I see that the tux.sys.* are:
> add_time_event
> clear_time_events
> events_list
> parent
> shell
> shell_free
> time
> time_events_Thread
> wait
>
> Can you explain a little how/what these functions do? How to act on
> running events, etc...
I personally can't as I don't know much more than you, still didn't do
much with the api yet. But as we urged rémi to write the documentation, he
should be adding docstrings in the api pretty soon.
I also suggested we write a tutorial with a script that would be well
documented and would demonstrate some functions/functionalities of the api
one by one in a sequence. That would help a lot to understand how to use
the api. This tutorial, once published on tuxisalive, will be copied in
the wiki to extend it to every function that is available in the api. When
really complete and mature, it will replace the simple one on the website.
So at the moment, I can't be of much help except urging to get that
documentation.
cheers,
david
|