[mythtvnz] tv_grab_nz-py

Nick Rout mythtvnz@lists.linuxnut.co.nz
Sat, 07 Jul 2007 10:35:26 +1200


Hadley Rich wrote:
> On Sat, 07 Jul 2007 00:55:28 Nick Rout wrote:
>   
>> Hads, I must be thick, but can you give me a quick pointer to why this
>> happens?
>>
>> nick@sf ~/tmp $ ./tv_grab_nz-py
>> Traceback (most recent call last):
>>   File "./tv_grab_nz-py", line 28, in ?
>>     log.critical('ElementTree is required and is not found')
>> NameError: name 'log' is not defined
>>
>>
>> Looks like I am missing something, but then you'd think it would fail on
>> an import statement or something (see I know THAT much about python LOL).
>>     
>
> Oops, sorry. You are right that you are missing something. I forgot to mention 
> that the grabber requires elementtree. It's included in Python as of 2.5 but 
> if you've got an older version you'll need the external package 
> (python-elementtree on Debian based systems).
>
> The reason it's not failing on the import is that I put a 'try' clause around 
> the import which allows you to catch errors. The problem is I then tried to 
> log the error before setting up the logging system.
>
> I've made a minor update and uploaded it. Cheers for bringing it to my 
> attention.
>   

Thanks, thats installed (very small emerge - 40kb)

I have python 2.4.2 and elementtree 1.2.6. I haven't downloaded your 
latest version.

Now I get this:

nick@sf ~/tmp $ ./tv_grab_nz-py --configure
INFO - Downloading data from epg.pvr.geek.nz...
INFO - Done
INFO - Parsing channel data...
Traceback (most recent call last):
  File "./tv_grab_nz-py", line 212, in ?
    doc = ElementTree.parse(StringIO(text)).getroot()
  File "/usr/lib/python2.4/site-packages/elementtree/ElementTree.py", 
line 859, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.4/site-packages/elementtree/ElementTree.py", 
line 578, in parse
    parser = XMLTreeBuilder()
  File "/usr/lib/python2.4/site-packages/elementtree/ElementTree.py", 
line 1114, in __init__
    raise ImportError(
ImportError: No module named expat; use SimpleXMLTreeBuilder instead





>   
>> Moreover can you tell me why it is i am trying this at 1.00 am?
>>     
>
> That I can't tell you :)
>
>   
>> Good night.
>>
>> Nick.
>>
>>     
>
>
>