0
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
1 #!/usr/bin/python
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
2 # Filename: mkhelpfiles.py
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
3
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
4
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
5 """
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
6 mkhelpfiles.py
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
7
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
8 Build MATLAB help files based on XML TOC.
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
9
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
10 Usage: mkhelpfiles.py -i helptoc.xml
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
11
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
12 M Hewitson 01-03-07
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
13
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
14 $Id: mkhelpfiles.py,v 1.3 2007/11/14 11:20:11 hewitson Exp $
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
15
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
16 """
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
17
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
18
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
19 import glob
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
20 import os
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
21 import sys
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
22 from string import *
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
23 import getopt
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
24 import platform
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
25 import time
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
26 import datetime
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
27
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
28
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
29 def extract(text, sub1, sub2):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
30 """extract a substring between two substrings sub1 and sub2 in text"""
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
31 print(text.split(sub1))
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
32 return text.split(sub1)[-1].split(sub2)[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
33
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
34 #######################################################################
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
35 #
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
36 # mkdir
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
37 #
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
38 def _mkdir(newdir):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
39 """works the way a good mkdir should :)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
40 - already exists, silently complete
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
41 - regular file in the way, raise an exception
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
42 - parent directory(ies) does not exist, make them as well
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
43 """
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
44 if os.path.isdir(newdir):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
45 pass
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
46 elif os.path.isfile(newdir):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
47 raise OSError("a file with the same name as the desired " \
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
48 "dir, '%s', already exists." % newdir)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
49 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
50 head, tail = os.path.split(newdir)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
51 if head and not os.path.isdir(head):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
52 _mkdir(head)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
53 #print "_mkdir %s" % repr(newdir)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
54 if tail:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
55 os.mkdir(newdir)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
56 return None;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
57
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
58
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
59
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
60 ######################################################################
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
61 # Main
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
62 #
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
63 def main():
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
64
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
65 try:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
66 opts, args = getopt.getopt(sys.argv[1:], "i:", ["input="])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
67 except getopt.GetoptError:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
68 print(__doc__)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
69 sys.exit(2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
70
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
71 # Default settings for database
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
72 tocfile = ''
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
73
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
74 # process args
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
75 for o, a in opts:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
76 if o in ("-i", "--input"):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
77 tocfile = a
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
78
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
79 # check for required fields
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
80 if tocfile=="":
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
81 print("\n### Incorrect inputs.")
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
82 print(__doc__)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
83 sys.exit(2)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
84
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
85 # Load XML file
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
86 try:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
87 fin = open(tocfile);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
88 allLines = fin.readlines();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
89 fin.close()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
90 except IOError:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
91 print("# error opening file.")
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
92 sys.exit(-1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
93
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
94 # Load Template file
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
95 try:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
96 fin = open('template.html');
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
97 templateFile = fin.read();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
98 fin.close()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
99 except IOError:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
100 print("# error opening file.")
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
101 sys.exit(-1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
102
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
103 # Go through each line and look for 'target='
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
104 entries = [];
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
105
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
106 for l in allLines:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
107 line = strip(l)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
108 if line.find("target=") > 0:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
109 tmp = split(line, "<")[1].split(">");
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
110 title = strip(tmp[1])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
111 htmlfile = strip(tmp[0].split('"')[1])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
112
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
113 # If this is an html file we can continue
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
114 if htmlfile.endswith('.html'):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
115 print "%s - %s" % (htmlfile, title)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
116
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
117 entry = {}
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
118 entry["html"] = htmlfile
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
119 entry["title"] = title
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
120 entries.append(entry)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
121
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
122
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
123 for j in range(0,len(entries)):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
124 entry = entries[j]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
125 print("--- Processing %s ------------------------" % entry)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
126 htmlfile = entry["html"]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
127 title = entry["title"]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
128
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
129 if len(split(htmlfile, '/')) == 2:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
130 outdir = split(htmlfile, '/')[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
131 outfile = split(htmlfile, '/')[1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
132 _mkdir(outdir)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
133 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
134 outdir = ''
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
135 outfile = split(htmlfile, '/')[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
136
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
137 # insert title
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
138 html = templateFile;
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
139 html = html.replace(">TITLE", ">%s"%title)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
140
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
141 # insert pre_title
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
142 if j>=1:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
143 lastentry = entries[j-1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
144 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
145 lastentry = entries[-1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
146
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
147 last = split(lastentry["html"], '/')[-1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
148 print("PRE: inserting %s" % last)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
149 html = html.replace("PRE_TITLE", lastentry["title"])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
150
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
151 # insert prehtml
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
152 html = html.replace("prehtml.html", last)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
153
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
154 # insert post_title
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
155 if j<len(entries)-1:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
156 nextentry = entries[j+1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
157 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
158 nextentry = entries[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
159
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
160 # print "POST: inserting %s" % split(nextentry["html"], '/')[-1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
161 next = split(nextentry["html"], '/')[-1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
162 print("POST: inserting %s" % next)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
163 html = html.replace("POST_TITLE", nextentry["title"])
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
164
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
165 # insert posthtml
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
166 html = html.replace("posthtml.html", next)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
167
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
168 # insert content link
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
169 contentFilePath = split(htmlfile, '.html')[0]+'_content.html'
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
170 if len(split(contentFilePath, '/'))>1:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
171 conoutdir = split(contentFilePath, '/')[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
172 conout = split(contentFilePath, '/')[1]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
173 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
174 conoutdir = ''
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
175 conout = split(contentFilePath, '/')[0]
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
176
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
177
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
178
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
179 # make contents version of htmlfile
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
180 # - only if file doesn't exist
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
181 if os.path.exists(contentFilePath):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
182 try:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
183 fin = open(contentFilePath);
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
184 line1 = fin.readline();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
185 if line1.startswith("<!-- $Id:"):
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
186 line1 = ""
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
187 content = line1+fin.read();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
188 fin.close()
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
189 except IOError:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
190 print("# error opening file.")
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
191 sys.exit(-1)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
192 else:
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
193 content = "<p>Content needs written...</p>"
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
194
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
195 html = html.replace("CONTENT", content)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
196 # write out
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
197 fout = open(htmlfile, "w+");
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
198 fout.write(html)
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
199 fout.close();
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
200
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
201 # call main
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
202 if __name__ == "__main__":
|
Daniele Nicolodi <nicolodi@science.unitn.it>
parents:
diff
changeset
|
203 main()
|