[mythtv-commits] Ticket #2393: MythArchive does not export sometimes, due to hascutlist / list index out of range.
MythTV
mythtv at cvs.mythtv.org
Fri Sep 15 09:31:57 UTC 2006
#2393: MythArchive does not export sometimes, due to hascutlist / list index out
of range.
--------------------------------+-------------------------------------------
Reporter: bsg104 at soton.ac.uk | Owner: paulh
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: mytharchive | Version: 0.20.1
Severity: medium |
--------------------------------+-------------------------------------------
Line 2875 of mythburn.py:
{{{
if file.attributes["usecutlist"].value == "1" and
getText(infoDOM.getElementsByTagName("hascutlist")[0]) == "yes":
}}}
Causes python to die with an list index out of range error.
Pseudo-traceback:
{{{
All in mythburn.py
Line: 3392, in ?
processJob(job)
Line: 3178, in processJob
processFile(node,folder)
Line: 2875, in processFile
if file.attributes["usecutlist"].value == "1" and
getText(infoDOM.getElementsByTagName("hascutlist")[0]) == "yes":
IndexError: list index out of range
}}}
I think that it is because this:
{{{
details = file.getElementsByTagName("details")
if details.length > 0:
}}}
(Which is around line 752?)
causes the code not to run the node = infoDOM.createElement("hascutlist")
sections, as this is in an elif block. So by writing a details section,
the hascutlist is missed out of the generated info.xml files.
I'm not sure how to fix this, as I dont know python, however, I copied the
section from the elif, and cut out all the duplicated code, leaving the
"hascutlist" creation and a few other bits, and now the script is actually
running.
I think that there should be an if around the content I copied
{{{
if file.attributes["type"].value=="recording":
}}}
But I dont really know, and I only export recordings, so I leave that up
to you! :)
There is almost definitely a much cleaner solution. *Shrugs*
I hope this helps.
Benjie.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/2393>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list