Mercurial > p > roundup > code
comparison roundup/templates/builder.py @ 1140:8622dc1bcf23
ahah, found ya
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 04:27:04 +0000 |
| parents | cf72eae57a2c |
| children | efaabc87f02e |
comparison
equal
deleted
inserted
replaced
| 1139:65e9dd4b59e1 | 1140:8622dc1bcf23 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: builder.py,v 1.2 2002-09-05 23:39:13 richard Exp $ | 18 # $Id: builder.py,v 1.3 2002-09-13 04:27:04 richard Exp $ |
| 19 import os, sys, glob, errno, re | 19 import os, sys, glob, errno, re |
| 20 | 20 |
| 21 __doc__ = """ | 21 __doc__ = """ |
| 22 Collect template parts and create instance template files. | 22 Collect template parts and create instance template files. |
| 23 """ | 23 """ |
| 71 if error.errno != errno.EEXIST: raise | 71 if error.errno != errno.EEXIST: raise |
| 72 | 72 |
| 73 # print "installing from", htmlbase.__file__, "into", installDir | 73 # print "installing from", htmlbase.__file__, "into", installDir |
| 74 modulecontents = dir(htmlbase) | 74 modulecontents = dir(htmlbase) |
| 75 for mangledfile in modulecontents: | 75 for mangledfile in modulecontents: |
| 76 if mangledfile[0] == "_": | |
| 77 continue | |
| 78 filename = re.sub('DOT', '.', mangledfile) | 76 filename = re.sub('DOT', '.', mangledfile) |
| 79 outfile = os.path.join(installDir, filename) | 77 outfile = os.path.join(installDir, filename) |
| 80 outfd = open(outfile, 'w') | 78 outfd = open(outfile, 'w') |
| 81 data = getattr(htmlbase, mangledfile) | 79 data = getattr(htmlbase, mangledfile) |
| 82 outfd.write(data) | 80 outfd.write(data) |
| 89 else: | 87 else: |
| 90 print "Usage: %s <template directory>"%sys.argv[0] | 88 print "Usage: %s <template directory>"%sys.argv[0] |
| 91 | 89 |
| 92 # | 90 # |
| 93 # $Log: not supported by cvs2svn $ | 91 # $Log: not supported by cvs2svn $ |
| 92 # Revision 1.2 2002/09/05 23:39:13 richard | |
| 93 # Fixed instance installation ... moved the htmlbase module into templates | |
| 94 # and call it <template>_htmlbase.py ... no more try/except in instance __init__! | |
| 95 # Added :required to form handling. | |
| 96 # Handle multiple values for single form items with decent error report. | |
| 97 # | |
| 94 # Revision 1.1 2002/08/16 04:25:03 richard | 98 # Revision 1.1 2002/08/16 04:25:03 richard |
| 95 # cleanup: moved templatebuilder into templates.builder | 99 # cleanup: moved templatebuilder into templates.builder |
| 96 # | 100 # |
| 97 # Revision 1.14 2002/02/05 09:59:05 grubert | 101 # Revision 1.14 2002/02/05 09:59:05 grubert |
| 98 # . makeHtmlBase: re.sub under python 2.2 did not replace '.', string.replace does it. | 102 # . makeHtmlBase: re.sub under python 2.2 did not replace '.', string.replace does it. |
