185 print "Creating output directory" |
185 print "Creating output directory" |
186 os.mkdir(output) |
186 os.mkdir(output) |
187 except StandardError, e: |
187 except StandardError, e: |
188 print >>sys.stderr, "Exception creating output directory %s: %s" % (output, e) |
188 print >>sys.stderr, "Exception creating output directory %s: %s" % (output, e) |
189 |
189 |
190 ## public dir |
190 # public dir |
191 for p in pyjs.path: |
191 for p in pyjs.path: |
192 pub_dir = join(p, 'public') |
192 pub_dir = join(p, 'public') |
193 if isdir(pub_dir): |
193 if isdir(pub_dir): |
194 print "Copying: public directory of library %r" % p |
194 print "Copying: public directory of library %r" % p |
195 copytree_exists(pub_dir, output) |
195 copytree_exists(pub_dir, output) |
196 |
196 |
197 ## AppName.html - can be in current or public directory |
197 # AppName.html - can be in current or public directory |
198 html_input_filename = app_name + ".html" |
198 html_input_filename = app_name + ".html" |
199 html_output_filename = join(output, basename(html_input_filename)) |
199 html_output_filename = join(output, basename(html_input_filename)) |
200 if os.path.isfile(html_input_filename): |
200 if os.path.isfile(html_input_filename): |
201 if not os.path.isfile(html_output_filename) or \ |
201 if not os.path.isfile(html_output_filename) or \ |
202 os.path.getmtime(html_input_filename) > \ |
202 os.path.getmtime(html_input_filename) > \ |
209 print "Copying: %(html_input_filename)s" % locals() |
209 print "Copying: %(html_input_filename)s" % locals() |
210 |
210 |
211 if check_html_file(html_input_filename, output): |
211 if check_html_file(html_input_filename, output): |
212 print >>sys.stderr, "Warning: Module HTML file %s has been auto-generated" % html_input_filename |
212 print >>sys.stderr, "Warning: Module HTML file %s has been auto-generated" % html_input_filename |
213 |
213 |
214 ## pygwt.js |
214 # pygwt.js |
215 |
215 |
216 print "Copying: pygwt.js" |
216 print "Copying: pygwt.js" |
217 |
217 |
218 pygwt_js_template = read_boilerplate(data_dir, "pygwt.js") |
218 pygwt_js_template = read_boilerplate(data_dir, "pygwt.js") |
219 pygwt_js_output = open(join(output, "pygwt.js"), "w") |
219 pygwt_js_output = open(join(output, "pygwt.js"), "w") |
220 |
220 |
221 print >>pygwt_js_output, pygwt_js_template |
221 print >>pygwt_js_output, pygwt_js_template |
222 |
222 |
223 pygwt_js_output.close() |
223 pygwt_js_output.close() |
224 |
224 |
225 ## Images |
225 # Images |
226 |
226 |
227 print "Copying: Images and History" |
227 print "Copying: Images and History" |
228 copy_boilerplate(data_dir, "corner_dialog_topleft_black.png", output) |
228 copy_boilerplate(data_dir, "corner_dialog_topleft_black.png", output) |
229 copy_boilerplate(data_dir, "corner_dialog_topright_black.png", output) |
229 copy_boilerplate(data_dir, "corner_dialog_topright_black.png", output) |
230 copy_boilerplate(data_dir, "corner_dialog_bottomright_black.png", output) |
230 copy_boilerplate(data_dir, "corner_dialog_bottomright_black.png", output) |
238 copy_boilerplate(data_dir, "tree_closed.gif", output) |
238 copy_boilerplate(data_dir, "tree_closed.gif", output) |
239 copy_boilerplate(data_dir, "tree_open.gif", output) |
239 copy_boilerplate(data_dir, "tree_open.gif", output) |
240 copy_boilerplate(data_dir, "tree_white.gif", output) |
240 copy_boilerplate(data_dir, "tree_white.gif", output) |
241 copy_boilerplate(data_dir, "history.html", output) |
241 copy_boilerplate(data_dir, "history.html", output) |
242 |
242 |
243 ## all.cache.html |
243 # all.cache.html |
244 app_files = generateAppFiles(data_dir, js_includes, app_name, debug, |
244 app_files = generateAppFiles(data_dir, js_includes, app_name, debug, |
245 output, dynamic, cache_buster, optimize) |
245 output, dynamic, cache_buster, optimize) |
246 |
246 |
247 ## AppName.nocache.html |
247 # AppName.nocache.html |
248 |
248 |
249 print "Creating: %(app_name)s.nocache.html" % locals() |
249 print "Creating: %(app_name)s.nocache.html" % locals() |
250 |
250 |
251 home_nocache_html_template = read_boilerplate(data_dir, "home.nocache.html") |
251 home_nocache_html_template = read_boilerplate(data_dir, "home.nocache.html") |
252 home_nocache_html_output = open(join(output, app_name + ".nocache.html"), |
252 home_nocache_html_output = open(join(output, app_name + ".nocache.html"), |