module dcop.: How to query running apps?

Discussion in 'Python' started by News123, Nov 9, 2008.

  1. News123

    News123 Guest

    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
    News123, Nov 9, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Williams

    PyQt and DCOP Documentation

    Eric Williams, Nov 10, 2003, in forum: Python
    Replies:
    6
    Views:
    450
    Fedor Sumkin
    Nov 11, 2003
  2. Replies:
    1
    Views:
    296
    R. C. James Harlow
    May 8, 2005
  3. Replies:
    2
    Views:
    327
  4. Jeffrey Barish

    Using DCOP from Python

    Jeffrey Barish, Dec 18, 2006, in forum: Python
    Replies:
    1
    Views:
    532
    David Boddie
    Dec 19, 2006
  5. DCOP memory leak?

    , Jan 30, 2007, in forum: Python
    Replies:
    5
    Views:
    298
Loading...

Share This Page