29
29
# prevent docutils from autoclosing the StringIO
30
30
xhtml_file.close = lambda: None
31
31
xhtml = publish_file(rest_file, writer_name='html', destination=xhtml_file,
34
36
xml = HTMLTreeBuilder.parse(xhtml_file)
40
43
return (template.serialize(output="html"))
43
46
def safe_open(filename, mode):
45
48
return open(filename, mode + 'b')
47
50
if e.errno != errno.ENOENT:
49
52
sys.stderr.write('file not found: %s\n' % sys.argv[2])