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

Brian J. Murrell brian at interlinx.bc.ca
Sat Jun 2 22:24:18 UTC 2012


On 12-06-02 05:05 PM, Michael T. Dean wrote:
> 
> Just to prove to myself that a non-Python-enabled person could write
> such a script using the fragment Raymond posted as a started, I went to
> http://www.mythtv.org/wiki/0.25_Python_Bindings and used some of the
> scripts at http://www.mythtv.org/wiki/Category:Python_Scripts as
> examples and came up with:
> 
> #!/usr/bin/env python
> import MythTV
> for prog in MythTV.MythBE().getPendingRecordings():
>      if prog.recstatus != MythTV.Program.rsInactive:
>          continue
>      print "{0.callsign:<8} {0.title:<40} {0.subtitle:<30}
> {0.starttime}".format(prog)
> 
> (Note that I took out the channel/chanid stuff since I wasn't sure what
> you were doing with that.)

As Raymond said, yeah, just A/D to signify if it was being shown on an
analog or a digital channel.

But your snippet prints all inactive programs, including the ones that
have already recorded episodes, not just "pilots and premiers".  But
your point is taken.

It doesn't change the fact that there is still some likely
never-reusable learning curve to getting something that does what you
want though.  I say "likely never-reusable" because it's use is so
infrequent that it practically becomes the same learning curve every
time, vs. the already-learned tools at hand.

I'd still end up spending some amount of time figuring out how the
classes work to take even your example to reach that only "pilots and
premieres" stage.  If I had to script myth stuff more frequently, I
fully admit that learning the binding might be worth it.

Just perusing, the data returned does look interesting but the
documentation of the classes doesn't seem to be entirely clear or
complete.  I noticed that getPendingRecordings() returns a list of
Program for example.  Clicking the link for Program I choose the 0.24
page for it given that the Master choice seems to go nowhere.  The page
on Data_Handlers has a brief description of a Program but I have to
believe there are a lot more fields available than just those listed.

I don't really mean this to be a critique of the lack of documentation,
indeed, at all.  But just an observation on the amount of work that one
would end up having to go through trawling the classes in the source to
figure this all out.

For example, how did you know "recstatus" was a member of the class
Program?  And how did you find out about the rsInactive constant?

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/20120602/b0b382df/attachment.sig>


More information about the mythtv-dev mailing list