module dcop.: How to query running apps?

N

News123

Hi,

I wrote a small application connecting to an application and sending
commands to it.


Currently I'm using the methods

import dcop
client = dcop.DCOPClient()
client.registerAs(appname)
ama = dcopclient.rc = dcop.DCOPRef("amarok", "player")

controlling the app works now fine with for example
ama.call('playPause()')

What I am missing is to have a save startup.
I'd like to know whether my dcop application is started and
ready to be connected to:

what I am doing currently is this running the shell command 'dcop'
and check it's result

def can_connect_to_amarok():
cmd = "dcop amarok player 2> /dev/null > /dev/null ; echo $?"
l = os.popen(cmd).readlines()
return l[0].strip() == '0'

however I guess, that the module is capable to do the same.

Unfortunaltely I had some difficulty googling for any examples

pydoc dcop mentions that the built in function exists, but doesn't list
its parameters.


I would also be interested in getting a list of methods of a given
application/module

currently I also use the shell function
dcop application module
to get the results.

thanks in advance for any suggestions to get rid of my 'pipe call'



N
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top