comparison document_it.py @ 26:ce7cbf3e08e1 default tip

fix bug with local files, index.html, and manifest order
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 04 Aug 2011 18:43:12 -0700
parents 0ce6b501f62d
children
comparison
equal deleted inserted replaced
25:0ce6b501f62d 26:ce7cbf3e08e1
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 """ 3 """
4 update MDN documentation from markdown 4 update MDN documentation from markdown
5 5
6 see: 6 for the MDN API see:
7 http://developer.mindtouch.com/en/ref/MindTouch_API/POST%3Apages%2F%2F%7Bpageid%7D%2F%2Fcontents 7 http://developer.mindtouch.com/en/ref/MindTouch_API/POST%3Apages%2F%2F%7Bpageid%7D%2F%2Fcontents
8 8
9 The manifest format is in the form: 9 The manifest format is in the form:
10 10
11 mozrunner/README.txt https://developer.mozilla.org/en/Mozrunner 11 mozrunner/README.txt https://developer.mozilla.org/en/Mozrunner
219 f.write(buffer) 219 f.write(buffer)
220 f.close() 220 f.close()
221 else: 221 else:
222 os.makedirs(dirname) 222 os.makedirs(dirname)
223 223
224 # render to index.html if the directory already exists
225 if os.path.isdir(dest):
226 dest = os.path.join(dest, 'index.html')
227
224 # render 228 # render
225 f = file(dest, 'w') 229 f = file(dest, 'w')
226 f.write(render(src)) 230 f.write(render(src))
227 f.close() 231 f.close()
228 232