From 59702e6c5bf978329b11dc40efa38cb6ff607058 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Sat, 3 Oct 2009 20:27:23 +1300 Subject: [PATCH] get_ncxtext wasn never actually working; fixed now --- epub.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/epub.py b/epub.py index 0474f7d..5d32893 100644 --- a/epub.py +++ b/epub.py @@ -288,9 +288,10 @@ def parse_spine(spine): def get_ncxtext(e): - #get text from an ... xconstruct - t = e.find(DAISYNS + 'text') - if t is not None: + """get text content from an ... construct, + as is common in NCX files.""" + # there will only be one , but for...iter is still easiest + for t in e.iter(DAISYNS + 'text'): return t.text return '' # or leave it at None? -- 2.11.4.GIT