[mythtv-users] python bindings

Raymond Wagner raymond at wagnerrp.com
Thu Jan 23 04:51:36 UTC 2014


On 1/22/2014 10:23 PM, Jeremy Jones wrote:
> Hey guys,  I'm trying to take a stab at a python script to create m3u
> playlist files from the playlists stored in the database.  Paul Harrison
> kindly supplied me with all the information I need regarding what field
> name and table to look in for the info I need.  Now I'm trying to figure
> out if everything I need to access those is already in the bindings.
>
> When searching the wiki for python bindings I get a link that when
> clicked redirects to .24 python bindings. When I search for .26 python
> bindings (I'm not on .27 yet), I can get to a page with an index, but
> most of the sub-titles listed redirect to .24 python bindings with the
> same name. Some redirect to .25.
>
> My questions are:
> 1) Were there really changes to the bindings between the release that
> would affect what I am wanting to do?

If they point to an old version, then there weren't any significant 
changes, and the old documentation should be accurate.

> 4) And this is really what I need: Is there a place that I can look that
> will tell me about accessing the following database tables using the
> python bindings?
>    a) music_playlists
>    b) music_songs
>    c) music_directories

The relevant pages list objects for those, but it seems I never filled 
them in.

http://www.mythtv.org/wiki/0.26_Python_bindings/Data_Handlers#MusicPlaylist

Also see...

http://code.mythtv.org/cgit/mythtv/tree/mythtv/bindings/python/MythTV/dataheap.py#n1229

In any case, they follow the same behavior of all other database-derived 
objects.  They can be accessed by the class constructor by using the 
table's primary keys, and all columns are accessible as attributes.  You 
can alter the attributes and run .update() to push the changes, or you 
can feed those changes into .update({}) with a dict argument.  You can 
create a new, empty object, populate it, and then push it with 
.create().  You can delete an existing object with .delete().


More information about the mythtv-users mailing list