File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 11
11
# then change the heading link name to something that does not look like an
12
12
# autogenerated link name.
13
13
###############################################################################
14
+ from __future__ import print_function
14
15
15
16
import sys
16
17
import re
17
- import string
18
18
19
19
###############################################################################
20
20
# Functions
@@ -58,11 +58,11 @@ def getheadingtext(m, s):
58
58
###############################################################################
59
59
60
60
if len (sys .argv ) != 3 :
61
- print "usage: makechap.py filename num"
61
+ print ( "usage: makechap.py filename num" )
62
62
sys .exit (1 )
63
63
64
64
filename = sys .argv [1 ]
65
- filenamebase = string .split (filename , "." )[0 ]
65
+ filenamebase = filename .split ("." )[0 ]
66
66
num = int (sys .argv [2 ])
67
67
68
68
section = 0
@@ -223,6 +223,6 @@ def getheadingtext(m, s):
223
223
# Print the TOC data to stdout correcting the anchor links for external referencing
224
224
225
225
index = index .replace ("<li><a href=\" #" ,"<li><a href=\" %s#" % filename )
226
- print """<h3><a href="%s#%s">%d %s</a></h3>\n """ % (filename ,filenamebase ,num ,name )
227
- print index
226
+ print ( """<h3><a href="%s#%s">%d %s</a></h3>\n """ % (filename ,filenamebase ,num ,name ) )
227
+ print ( index )
228
228
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
3
+ from __future__ import print_function
3
4
import sys
4
5
import os
5
6
chs = open ("chapters" ).readlines ()
6
7
7
8
f = open ("Contents.html" ,"w" )
8
- print >> f , """
9
+ f . write ( """
9
10
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
10
11
<HTML>
11
12
<HEAD>
17
18
<H1><a name="Contents"></a>SWIG Users Manual</H1>
18
19
19
20
<p>
20
- """
21
+
22
+ """ )
21
23
22
24
f .close ()
23
25
24
26
num = 1
25
27
26
28
for c in chs :
27
29
c = c .strip ()
28
- print "Processing %s" % c
30
+ print ( "Processing " + c )
29
31
if c :
30
32
os .system ("python makechap.py %s %d >> Contents.html" % (c ,num ))
31
33
num += 1
32
-
34
+
33
35
f = open ("Contents.html" ,"a" )
34
- print >> f , """
36
+ f . write ( """
35
37
</BODY>
36
38
</HTML>
37
- """
39
+
40
+ """ )
38
41
39
42
You can’t perform that action at this time.
0 commit comments