I think at the moment that ncx is build (rebuild?) on the fly when you open a book (Devs please?).
And of course I've seen yours commented out... I've partly uncommented - and added my own to verify.
And of course (Google is the saviour!) I don't speak python

.
tk (and SmartyPants!) was not included in my standard python installation - so it is quite ok to use qt I guess.