PyQt and DCOP Documentation

Eric Williams s-rube at uselessbastard.net
Sun Nov 9 19:35:17 EST 2003


Is there any reasonable documentation (i.e., with full examples and/or code
snippets or argument lists or anything)  to be found for using python with
Qt/DCOP?  "Fully Implemented." does not constitute complete documentation
when you're c++ illiterate.

I'm actually just trying to get the volume level out of noatun in a python
script, if anyone can help me with an example. What, exactly, does one DO
with a QByteArray in python?

Thanks a bunch,
Eric


(current non-functioning attempt below)
---------------
class Noatun(dcop.DCOPClient):
        def __init__(self):
                dcop.DCOPClient.__init__(self)
                self.appname="NoatunPeeker"
                self.attach()
                self.registerAs(self.appname)
                if self.isAttached():
                        self.rc = dcop.DCOPRef("noatun","Noatun")
                else:
                        print "Couldn't attach!"
                        sys.exit(1)

        def getvol(self):
                res = self.rc.call("volume()")
                if res.isValid():
                        return str(res.data)
                        #returns '(' why?
                else:
                        return "Couldn't call"

        def gettitle(self):
                res = self.rc.call("title()")
                if res.isValid():
                        return str(res.data)
                        #works as expected
                else:
                        return "Couldn't call"

if __name__=="__main__":
        n = Noatun()
        print n.getvol()
        print n.gettitle()





-- 
---
s- should be removed to contact me...




More information about the Python-list mailing list