module dcop.: How to query running apps?

News123 news123 at
Sun Nov 9 20:45:23 CET 2008


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()
ama  = dcopclient.rc = dcop.DCOPRef("amarok", "player")

controlling the app works now fine with for example'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

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'


More information about the Python-list mailing list