[mythtv] Format of new post-0.25 config.xml

Brian J. Murrell brian at interlinx.bc.ca
Sun Jun 3 17:32:37 UTC 2012


On 12-06-02 08:18 PM, Michael T. Dean wrote:
>  
> #!/usr/bin/env python
> import MythTV
> rules = [r.recordid for r in MythTV.Record.getAllEntries() if "First
> Episodes" in r.title]
> for prog in MythTV.MythBE().getPendingRecordings():
> #    if prog.recstatus != MythTV.Program.rsInactive:
>     if prog.recordid not in rules:
>         continue
>     print "{0.recordid:<5} {0.callsign:<8} {0.title:<40}
> {0.subtitle:<30} {0.starttime}".format(prog)

Again, that seems to start doing the right thing and then pretty quickly
falls over with:

    print "{0.callsign:<8} {0.title:<40} {0.subtitle:<30}
{0.starttime}".format(prog)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in
position 27: ordinal not in range(128)

Anyone want to tell me the python unicode goop to make this go away?

> Please don't try to say that your SQL left join with was "already
> learned"--you /definitely/ had to dig deep

Naw, not so deep I don't think.  I recall it was pretty readily
available either by googling or by analyzing what myth was doing in the
equivalent "power search".  I'm certainly no SQL expert.  I'm really not
entirely clear what left join does.  :-)

> (not to mention a
> sed/tr/bash expert :).

That I am a bit of an expert in.  :-)

> And, that query can break as MythTV changes
> (meaning you'll have to do it--and learn it--over again).

Yes, that is the downfall, I do understand.

> More than anything, I knew about those from knowing about the MythTV
> internal ProgramInfo class as well as the database program table.

Right.  Without that "built-in" knowledge, one ends up having to read
the bindings source to understand what's available.  The mysql
command-line on the other hand makes it pretty easy to figure out some
SQL to get what you want.

> The
> data types in the Python bindings are pretty much just mapped from the
> database tables.  However, a grep for "class Program" shows that it's
> defined in bindings/python/MythTV/mythproto.py , and lists the fields at
> https://github.com/MythTV/mythtv/blob/master/mythtv/bindings/python/MythTV/mythproto.py#L813
> .
> 
> And, as for the values for the recstatus field, the statics.py file I
> linked, above, shows those options.

Thanks much for all of that.

Cheers,
b.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://www.mythtv.org/pipermail/mythtv-dev/attachments/20120603/ab35acdf/attachment.sig>


More information about the mythtv-dev mailing list