[mythtv-users] Python Bindings Question

Raymond Wagner raymond at wagnerrp.com
Wed Jun 27 13:58:49 UTC 2012


On 6/25/2012 23:16, Michael Watson wrote:
> Is it possible to retrieve using Python Bindings the Pending Recordings
> including the encoder # the BE intends to use to record the program?
>
> If this is not possible, (and I need to parse the XML Status page), the
> is it possible to determine the MBE's hostname via the bindings, or is
> the only approach to query the settings for the masterbackendip and do a
> ip lookup for the the hostname?
>
> Or is the a simpler approach to retrieving the desired information using
> Python?

I've been having some mail server issues recently with my IP frequently 
changing, so I just now received this.

 >>> import MythTV
 >>> be = MythTV.MythBE()
 >>> prog = be.getUpcomingRecordings().next()
 >>> prog
<Program 'NOVA','2012-07-06 04:00:00' at 0x808c7c460>
 >>> prog.cardid
1
 >>> class CaptureCard( MythTV.database.DBData ): pass
...
 >>> card = CaptureCard(prog.cardid)
 >>> for k in 'cardid', 'videodevice', 'cardtype', 'hostname':
...     print "{0:<15} - {1}".format(k, card[k])
cardid          - 1
videodevice     - 1013FA3F-0
cardtype        - HDHOMERUN
hostname        - mythbe


The MythBE class has methods getPendingRecordings(), 
getScheduledRecordings(), getUpcomingRecordings(), and 
getConflictedRecordings().  Note that only certain recording statuses 
will result in a Program object with a defined cardid.


More information about the mythtv-users mailing list