comparison roundup/templates/builder.py @ 1141:efaabc87f02e

no, really
author Richard Jones <richard@users.sourceforge.net>
date Fri, 13 Sep 2002 04:39:12 +0000
parents 8622dc1bcf23
children
comparison
equal deleted inserted replaced
1140:8622dc1bcf23 1141:efaabc87f02e
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.3 2002-09-13 04:27:04 richard Exp $ 18 # $Id: builder.py,v 1.4 2002-09-13 04:39:12 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.startswith('__') and mangledfile.endswith('__'):
77 continue
76 filename = re.sub('DOT', '.', mangledfile) 78 filename = re.sub('DOT', '.', mangledfile)
77 outfile = os.path.join(installDir, filename) 79 outfile = os.path.join(installDir, filename)
78 outfd = open(outfile, 'w') 80 outfd = open(outfile, 'w')
79 data = getattr(htmlbase, mangledfile) 81 data = getattr(htmlbase, mangledfile)
80 outfd.write(data) 82 outfd.write(data)
85 elif len(sys.argv) == 3: 87 elif len(sys.argv) == 3:
86 installHtmlBase(sys.argv[1], sys.argv[2]) 88 installHtmlBase(sys.argv[1], sys.argv[2])
87 else: 89 else:
88 print "Usage: %s <template directory>"%sys.argv[0] 90 print "Usage: %s <template directory>"%sys.argv[0]
89 91
90 #
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 #
98 # Revision 1.1 2002/08/16 04:25:03 richard
99 # cleanup: moved templatebuilder into templates.builder
100 #
101 # Revision 1.14 2002/02/05 09:59:05 grubert
102 # . makeHtmlBase: re.sub under python 2.2 did not replace '.', string.replace does it.
103 #
104 # Revision 1.13 2001/11/22 15:46:42 jhermann
105 # Added module docstrings to all modules.
106 #
107 # Revision 1.12 2001/11/14 21:35:21 richard
108 # . users may attach files to issues (and support in ext) through the web now
109 #
110 # Revision 1.11 2001/08/07 00:24:42 richard
111 # stupid typo
112 #
113 # Revision 1.10 2001/08/07 00:15:51 richard
114 # Added the copyright/license notice to (nearly) all files at request of
115 # Bizar Software.
116 #
117 # Revision 1.9 2001/08/01 05:06:10 richard
118 # htmlbase doesn't have extraneous $Foo$ in it any more
119 #
120 # Revision 1.8 2001/07/30 08:12:17 richard
121 # Added time logging and file uploading to the templates.
122 #
123 # Revision 1.7 2001/07/30 00:06:52 richard
124 # Hrm - had IOError instead of OSError. Not sure why there's two. Ho hum.
125 #
126 # Revision 1.6 2001/07/29 07:01:39 richard
127 # Added vim command to all source so that we don't get no steenkin' tabs :)
128 #
129 #
130 #
131 # vim: set filetype=python ts=4 sw=4 et si 92 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/