diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2011-11-03 19:52:20 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2011-11-07 15:50:30 (GMT) |
commit | 996d542fd7d2d464edd572b165e80f9cb2c20ec7 (patch) | |
tree | 3b1cddc371ea986c51590db07d90423b12e65507 /epubview/navmap.py | |
parent | 2f2b3e99fc21d4386c8ce03b051d853937d955ac (diff) |
Initial port to Gtk3
Diffstat (limited to 'epubview/navmap.py')
-rw-r--r-- | epubview/navmap.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/epubview/navmap.py b/epubview/navmap.py index 612f2d1..fa3713b 100644 --- a/epubview/navmap.py +++ b/epubview/navmap.py @@ -1,5 +1,6 @@ from lxml import etree -import gtk +from gi.repository import Gtk +import logging class NavPoint(object): @@ -25,7 +26,7 @@ class NavMap(object): self._opffile = opffile self._tree = etree.parse(ncxfile) self._root = self._tree.getroot() - self._gtktreestore = gtk.TreeStore(str, str) + self._gtktreestore = Gtk.TreeStore(str, str) self._flattoc = [] self._populate_flattoc() @@ -62,8 +63,11 @@ class NavMap(object): def _getcontent(self, navpoint): text = navpoint.find( - './{http://www.daisy.org/z3986/2005/ncx/}content/') - return self._basepath + text.get('src') + './{http://www.daisy.org/z3986/2005/ncx/}content') + if text is not None: + return self._basepath + text.get('src') + else: + return "" def _process_navpoint(self, navpoint, parent=None): title = self._gettitle(navpoint) |