/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/rst2prettyhtml.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python3
 
1
#!/usr/bin/env python
2
2
 
3
3
import errno
4
4
import os
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,
32
 
                         settings_overrides={"doctitle_xform": 0})
 
32
                         settings_overrides={"doctitle_xform": 0} 
 
33
    
 
34
    )
33
35
    xhtml_file.seek(0)
34
36
    xml = HTMLTreeBuilder.parse(xhtml_file)
35
37
    head = xml.find('head')
36
38
    body = xml.find('body')
37
39
    assert head is not None
38
40
    assert body is not None
39
 
    template = kid.Template(file=template_name, head=head, body=body)
 
41
    template=kid.Template(file=template_name, 
 
42
                          head=head, body=body)
40
43
    return (template.serialize(output="html"))
41
44
 
42
45