[mythtv-users] mythcal - script for synchronising MythTV recording schedule to a Google calendar

Raymond Wagner raymond at wagnerrp.com
Mon Oct 12 02:11:14 UTC 2009


On 10/11/2009 18:14, Michael T. Dean wrote:
> On 10/11/2009 04:37 PM, Richard Fearn wrote:
>> It should be putting all of your upcoming recordings into the
>> calendar. It should be OK for one-off recordings, but it might not
>> work 100% for recurring recordings, for example. I hope to look into
>> this soon.
>
> Rather than re-implement the scheduler logic in Python, you should 
> really look at using the MythTV Python bindings to just ask the 
> backend for the information you need.  It will give you a list of 
> every single recording scheduled within the listings period--and much, 
> much, more, if you desire.
>
> The Python bindings in 0.22 should be in very good shape--they should 
> be light years ahead of even the Perl bindings (which were--until the 
> Python bindings were updated by Raymond Wagner--considered to be in 
> good shape).

Here's a quick twenty minute rewrite using the python bindings.  It's 
untested, but it should work.  It may need the latest patch on #6885, so 
that Program is a 'new-style' class that can be subclassed.  The Program 
class just hands you naive datetime.datetime() objects for starttime and 
endtime in local time, so you'll have to figure out how to convert them 
to UTC.  I don't know off hand, but I put a comment in the code where 
you should.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mythcal.py
URL: <http://mythtv.org/pipermail/mythtv-users/attachments/20091011/b20b6bb8/attachment-0001.asc>


More information about the mythtv-users mailing list