equal
deleted
inserted
replaced
141 filename = os.path.split(source_file)[1] |
141 filename = os.path.split(source_file)[1] |
142 mod_name = os.path.splitext(filename)[0] |
142 mod_name = os.path.splitext(filename)[0] |
143 file_name = os.path.join(dest_path, mod_name + '.html') |
143 file_name = os.path.join(dest_path, mod_name + '.html') |
144 |
144 |
145 # if html file in output directory exists, leave it alone. |
145 # if html file in output directory exists, leave it alone. |
146 if os.path.exists (file_name): |
146 if os.path.exists(file_name): |
147 return 0 |
147 return 0 |
148 |
148 |
149 if os.path.exists(os.path.join(dest_path, mod_name + '.css')): |
149 if os.path.exists(os.path.join(dest_path, mod_name + '.css')): |
150 css = "<link rel='stylesheet' href='" + mod_name + ".css'>" |
150 css = "<link rel='stylesheet' href='" + mod_name + ".css'>" |
151 elif os.path.exists(os.path.join(dest_path, 'pyjamas_default.css')): |
151 elif os.path.exists(os.path.join(dest_path, 'pyjamas_default.css')): |
156 |
156 |
157 title = 'PyJamas Auto-Generated HTML file ' + mod_name |
157 title = 'PyJamas Auto-Generated HTML file ' + mod_name |
158 |
158 |
159 base_html = base_html % {'modulename': mod_name, 'title': title, 'css': css} |
159 base_html = base_html % {'modulename': mod_name, 'title': title, 'css': css} |
160 |
160 |
161 fh = open (file_name, 'w') |
161 fh = open(file_name, 'w') |
162 fh.write (base_html) |
162 fh.write(base_html) |
163 fh.close () |
163 fh.close() |
164 |
164 |
165 return 1 |
165 return 1 |
166 |
166 |
167 |
167 |
168 def build(app_name, output, js_includes=(), debug=False, dynamic=0, |
168 def build(app_name, output, js_includes=(), debug=False, dynamic=0, |