Mercurial > p > roundup > code
comparison roundup/templatebuilder.py @ 167:a49c8a2ddd26
Added time logging and file uploading to the templates.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 30 Jul 2001 08:12:17 +0000 |
| parents | 16fdc86183fe |
| children | 2775f6727070 |
comparison
equal
deleted
inserted
replaced
| 166:d469fb3beda1 | 167:a49c8a2ddd26 |
|---|---|
| 1 # $Id: templatebuilder.py,v 1.7 2001-07-30 00:06:52 richard Exp $ | 1 # $Id: templatebuilder.py,v 1.8 2001-07-30 08:12:17 richard Exp $ |
| 2 import errno | 2 import errno |
| 3 | 3 |
| 4 preamble = """ | 4 preamble = """ |
| 5 # Do Not Edit (Unless You Want To) | 5 # Do Not Edit (Unless You Want To) |
| 6 # This file automagically generated by roundup.htmldata.makeHtmlBase | 6 # This file automagically generated by roundup.htmldata.makeHtmlBase |
| 16 filelist = filter(os.path.isfile, filelist) # only want files | 16 filelist = filter(os.path.isfile, filelist) # only want files |
| 17 filelist.sort() | 17 filelist.sort() |
| 18 fd = open(os.path.join(templateDir, 'htmlbase.py'), 'w') | 18 fd = open(os.path.join(templateDir, 'htmlbase.py'), 'w') |
| 19 fd.write(preamble) | 19 fd.write(preamble) |
| 20 for file in filelist: | 20 for file in filelist: |
| 21 # skip the backup files created by richard's vim | |
| 22 if file[-1] == '~': continue | |
| 21 mangled_name = os.path.basename(re.sub(r'\.', 'DOT', file)) | 23 mangled_name = os.path.basename(re.sub(r'\.', 'DOT', file)) |
| 22 fd.write('%s = """'%mangled_name) | 24 fd.write('%s = """'%mangled_name) |
| 23 fd.write(open(file).read()) | 25 fd.write(open(file).read()) |
| 24 fd.write('"""\n\n') | 26 fd.write('"""\n\n') |
| 25 fd.close() | 27 fd.close() |
| 63 else: | 65 else: |
| 64 raise "what you talkin about willis?" | 66 raise "what you talkin about willis?" |
| 65 | 67 |
| 66 # | 68 # |
| 67 # $Log: not supported by cvs2svn $ | 69 # $Log: not supported by cvs2svn $ |
| 70 # Revision 1.7 2001/07/30 00:06:52 richard | |
| 71 # Hrm - had IOError instead of OSError. Not sure why there's two. Ho hum. | |
| 72 # | |
| 68 # Revision 1.6 2001/07/29 07:01:39 richard | 73 # Revision 1.6 2001/07/29 07:01:39 richard |
| 69 # Added vim command to all source so that we don't get no steenkin' tabs :) | 74 # Added vim command to all source so that we don't get no steenkin' tabs :) |
| 70 # | 75 # |
| 71 # | 76 # |
| 72 # | 77 # |
