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

Jean-Yves Avenard jyavenard at gmail.com
Sun Jun 3 06:13:48 UTC 2012


Hi

On Sunday, 3 June 2012, Raymond Wagner wrote:

> On 6/2/2012 13:33, Brian J. Murrell wrote:
>
>> On
>
> ------
> #!/usr/bin/env python
> import MythTV
> import functools
> import datetime
>
> @functools.total_ordering
> class MySort( object ):
>    def __lt__(self, other):
>        if self.starttime == other.starttime:
>            return self.title < other.title
>        return self.starttime < other.starttime
>    def __eq__(self, other):
>        if (self.starttime == other.starttime) and \
>                (self.title == other.title):
>            return True
>        return False
>
> class MyGuide( MySort, MythTV.Guide ):
>    def pprint(self):
>        chan = MythTV.Channel(self.chanid)
>        print "{0}/{1:<8} {2.title:<40} {2.subtitle:<30}
> {2.starttime}".format("A" if chan.sourceid==1 else "D", chan.callsign, self)
>
> MythTV.MythDB.searchGuide.**handler = MyGuide
>
> now = datetime.datetime.now()
> past = now - datetime.timedelta(days=60)
>
> db = MythTV.MythDB()
> for prog in sorted(db.searchGuide(first=**True, startafter=now,
> custom=(("programid LIKE ?","EP%0001"),("**originalairdate>?", past)))):
>    prog.pprint()
> ------
>
>
>
To be honest, this doesn't look any easier to me, and from a glance I can't
tell what it is doing.

It also seems that you need need to have a fairly good knowledge on the
internal MySQL structure in order to use the bindings or at least make
sense of the database access. Which kind of defeat the purpose of having an
abstraction layer IMHO.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-dev/attachments/20120603/23870572/attachment.html>


More information about the mythtv-dev mailing list