View Single Post
Old 12-31-2012, 04:04 AM   #462
Sergey Dubinets
Junior Member
Sergey Dubinets began at the beginning.
Posts: 6
Karma: 10
Join Date: Dec 2012
Device: Kindle
v0.61beta works well.

Here are some comments so far:

1. we don't need to import readTagSection, getVariableWidthValue to this module.

2. Program can print nice disagnostic. The problem is that it prints UTF-8 strings to console. This works only for

english text (at list on WIndows). When I debug Russian books I see less readable debug output.

3. escape/unescape in OPF. You recently added HTMLParser.unescape(). Are you sure that original values are

escaped? Unescaping on not escaped values would be a bug.
Using saxutils.escape() is correct for text nodes:
data.append('<%s>%s</%s>\n' % (tag, xmlescape(self.h.unescape(value)), closingTag))
And is not suficient

for attribute values:
data.append('<meta name="%s" content="%s" />\n' % (name, xmlescape(self.h.unescape(value))))

I later case you need also escape " as &quot; and ' as &apos;
I sugest you use quoteattr() for atributes instead of escape()

4. Why you don't use setsectiondescription() method? The same with 6 other ocations in the same


5. Redundant call. the same 696, 697, 698

6. method is never used

7. duplicate map entry
Sergey Dubinets is offline   Reply With Quote