Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > module dcop.: How to query running apps?

Reply
Thread Tools

module dcop.: How to query running apps?

 
 
News123
Guest
Posts: n/a
 
      11-09-2008
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










 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Re: module docstring, documentation,anything? please note is the module type/object NOT some module Maric Michaud Python 0 06-24-2006 12:42 PM
Trying to query the Address table data of AdventureWorks database from Query Analyzer - need help! Learner ASP .Net 1 01-30-2006 08:58 PM
Build dynamic sql query for JSTL <sql:query> Anonymous Java 0 10-13-2005 10:01 PM
xpath query query David Gordon XML 2 05-18-2005 03:33 PM



Advertisments