/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: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import errno
4
4
import os
5
 
from breezy.sixish import StringIO
 
5
from StringIO import StringIO
6
6
import sys
7
7
 
8
8
try:
9
9
    from docutils.core import publish_file
10
10
    from docutils.parsers import rst
11
11
except ImportError:
12
 
    print("Missing dependency.  Please install docutils.")
 
12
    print "Missing dependency.  Please install docutils."
13
13
    sys.exit(1)
14
14
try:
15
15
    from elementtree.ElementTree import XML
16
16
    from elementtree import HTMLTreeBuilder
17
17
except ImportError:
18
 
    print("Missing dependency.  Please install ElementTree.")
 
18
    print "Missing dependency.  Please install ElementTree."
19
19
    sys.exit(1)
20
20
try:
21
21
    import kid
22
22
except ImportError:
23
 
    print("Missing dependency.  Please install Kid.")
 
23
    print "Missing dependency.  Please install Kid."
24
24
    sys.exit(1)
25
25
 
26
26
 
46
46
def safe_open(filename, mode):
47
47
    try:
48
48
        return open(filename, mode + 'b')
49
 
    except IOError as e:
 
49
    except IOError, e:
50
50
        if e.errno != errno.ENOENT:
51
51
            raise
52
52
        sys.stderr.write('file not found: %s\n' % sys.argv[2])