[mythtv-commits] Ticket #8577: Python Bindings Reorganization

MythTV mythtv at cvs.mythtv.org
Tue Jul 6 16:20:20 UTC 2010


#8577: Python Bindings Reorganization
-------------------------------+--------------------------------------------
 Reporter:  wagnerrp           |       Owner:  wagnerrp  
     Type:  task               |      Status:  accepted  
 Priority:  minor              |   Milestone:  0.24      
Component:  Bindings - Python  |     Version:  Trunk Head
 Severity:  medium             |     Mlocked:  0         
-------------------------------+--------------------------------------------

Comment(by wagnerrp):

 (In [25274]) This commit tweaks the DBData[Write] classes, and adds
 several classes
     for working with MythMusic database tables.

 DBData classes now accept a '_key' parameter. This parameter is a list
     providing the database fields to be used to link an object to an
     entry in the database. This replaces the previous '_where' and
     '_setwheredat' fields.

     The '_key' parameter will set the other two values as:
         _where = ' AND '.join(_key)
         _setwheredat = ','.join(_key)+','
     If more control is needed, these values can still be set manually.

 DBDataWrite.create() now returns a fully usable object, rather than the
     last rowid. This method now only works properly if the unique
     identifier defined by the '_where' parameter is defined by the user.
     The old behavior of 'create()' is now found in the '_create()' method,
     if more control is needed than the new behavior provides.

 DBDataWriteAI is a new class is a modified DBDataWrite specifically for
     use with tables that use an Auto-Incrementing id field as the unique
     identifier.

 DBData._evalwheredat() is now the only thing that should be setting the
     '_wheredat' parameter, and so must be run to tie an object to an entry
     in the database.  That means this method can be overridden to provide
     any code that must be run after an object is fully mapped, replacing
     '_postinit()'. '_evalwheredat()' now accepts an optional tuple, to
     allow '_wheredat' to be set directly, rather than pulling from data
     in the object.

 Basic support for access to MythMusic data has been added, with the
     following classes:
       Song
       Album
       Artist
       MusicPlaylist
       MusicDirectory
     These classes all have several classmethods, allowing them to be
         initialized off of each other.
     Also added is a MythMusic class offering a 'searchMusic' method.

 Refs #8577

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/8577#comment:10>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list