[mythtvnz] Finding a gap in the MythTV Scheduler
Steven Ellis
mythtvnz@lists.linuxnut.co.nz
Sat, 19 May 2007 10:51:09 +1200
This is a multi-part message in MIME format.
--------------020502000906080400040006
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hadley Rich wrote:
> On Mon, 16 Apr 2007 21:22:29 Steven Ellis wrote:
>
>> On Mon, April 16, 2007 8:50 pm, Hadley Rich wrote:
>>
>>> I'm in the process of writing python bindings/library to make it easy to
>>> write python scripts that interface to mythtv. This is something that
>>> could be incorporated.
>>>
>> Your bindings would be awesome.
>>
>
> My initial attempt has been committed to trunk;
>
> http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV.py
>
> It's in the mythvideo scripts directory at present as that's the only thing
> that uses it.
>
> I included a function in the module which will give you a list of upcoming
> recordings quite easily.
>
> import MythTV
> m = MythTV.MythTV()
>
> upcoming = m.getUpcomingRecordings()
>
> print upcoming[0].title, upcoming[0].recstartts
>
> If you've got trunk and want to have a play it may be of use.
>
>
Finally have a chance to try your code out, and sadly we base our build
of 0.20-fixes. Any tips on getting it running?
I created a file test.py as follows
#!/usr/bin/python
import MythTV
m = MythTV.MythTV()
upcoming = m.getUpcomingRecordings()
print upcoming[0].title, upcoming[0].recstartts
Then running it produces
mythtv@mythtv:~$ ./test.py
Traceback (most recent call last):
File "./test.py", line 3, in ?
m = MythTV.MythTV()
File "/home/mythtv/MythTV.py", line 135, in __init__
self.db = get_database_connection()
NameError: global name 'get_database_connection' is not defined
Got any pointers?
Steve
--
Steven Ellis - Technical Director
OpenMedia Limited
email - steven@openmedia.co.nz
sales - sales@openmedia.co.nz
support - support@openmedia.co.nz
website - http://www.openmedia.co.nz
--------------020502000906080400040006
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hadley Rich wrote:
<blockquote cite="mid200705080927.35688.hads@nice.net.nz" type="cite">
<pre wrap="">On Mon, 16 Apr 2007 21:22:29 Steven Ellis wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On Mon, April 16, 2007 8:50 pm, Hadley Rich wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I'm in the process of writing python bindings/library to make it easy to
write python scripts that interface to mythtv. This is something that
could be incorporated.
</pre>
</blockquote>
<pre wrap="">Your bindings would be awesome.
</pre>
</blockquote>
<pre wrap=""><!---->
My initial attempt has been committed to trunk;
<a class="moz-txt-link-freetext" href="http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV.py">http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythvideo/mythvideo/scripts/MythTV.py</a>
It's in the mythvideo scripts directory at present as that's the only thing
that uses it.
I included a function in the module which will give you a list of upcoming
recordings quite easily.
import MythTV
m = MythTV.MythTV()
upcoming = m.getUpcomingRecordings()
print upcoming[0].title, upcoming[0].recstartts
If you've got trunk and want to have a play it may be of use.
</pre>
</blockquote>
Finally have a chance to try your code out, and sadly we base our build
of 0.20-fixes. Any tips on getting it running?<br>
<br>
I created a file test.py as follows<br>
<br>
#!/usr/bin/python<br>
import MythTV<br>
m = MythTV.MythTV()<br>
<br>
upcoming = m.getUpcomingRecordings()<br>
<br>
print upcoming[0].title, upcoming[0].recstartts<br>
<br>
<br>
Then running it produces<br>
<br>
mythtv@mythtv:~$ ./test.py<br>
Traceback (most recent call last):<br>
File "./test.py", line 3, in ?<br>
m = MythTV.MythTV()<br>
File "/home/mythtv/MythTV.py", line 135, in __init__<br>
self.db = get_database_connection()<br>
NameError: global name 'get_database_connection' is not defined<br>
<br>
<br>
Got any pointers?<br>
<br>
Steve<br>
<br>
<pre class="moz-signature" cols="72">--
Steven Ellis - Technical Director
OpenMedia Limited
email - <a class="moz-txt-link-abbreviated" href="mailto:steven@openmedia.co.nz">steven@openmedia.co.nz</a>
sales - <a class="moz-txt-link-abbreviated" href="mailto:sales@openmedia.co.nz">sales@openmedia.co.nz</a>
support - <a class="moz-txt-link-abbreviated" href="mailto:support@openmedia.co.nz">support@openmedia.co.nz</a>
website - <a class="moz-txt-link-freetext" href="http://www.openmedia.co.nz">http://www.openmedia.co.nz</a>
</pre>
</body>
</html>
--------------020502000906080400040006--