[mythtv] Re: python bindings

Phil Thompson phil at river-bank.demon.co.uk
Thu Dec 9 17:52:54 UTC 2004


>>Has anyone thought of adding python bindings to make it easier for
>>people to add plugins? Easier for me anyhow =)
>>
>>If no one is tackling this, I may give it a go. I'm thinking some
>>combination of the Qt python bindings plus a custom C++ layer to tie
>>myth into python, i.e. expose the myth classes as python classes.
>>
>>Anyone have any suggestions?
>
> Just a thought, but couldn't you use swig (http://www.swig.org/).  This
> way,
> you could define the interace to libmyth once, and then automatically
> generate bindings to perl/python/ruby/whatever.
>
> Anyone see a problem with this?

It depends on how "Qt-ish" the myth API is. If plugins want to take
advantage of the Qt API (either explicitly, or implicitly because the myth
API sub-classes from Qt classes) then it's not a good idea because you
have have to use SWIG to wrap Qt as well. On the other hand, if the myth
API doesn't expose Qt then it's more practical.

PyQt is build using SIP
(http://www.river-bank.demon.co.uk/docs/sip/sipref.html) which makes it
easy to define new Python modules that extend existing ones (like PyQt).
PyQt doesn't use SWIG because (historically) the C++ support has been less
than ideal.

Phil



More information about the mythtv-dev mailing list