source: traclegosscript/anyrelease/traclegos/pastescript/template.py

Last change on this file was 4230, checked in by Jeff Hammel, 15 years ago

preliminary support for template creation

File size: 752 bytes
Line 
1import os
2import shutil
3from paste.script import templates
4
5var = templates.var
6
7class TracProjectTemplate(templates.Template):
8    _template_dir = 'template'
9    summary = 'templatize configuration for a trac project'
10    vars = [
11        var('file', 'file or project to templatize'),
12        var('description', 'One-line description of the package'),
13        ] 
14
15    def pre(self, command, output_dir, vars):
16        pass
17
18    def post(self, command, output_dir, vars):
19        if os.path.exists(vars['file']):
20            shutil.copy(vars['file'], 
21                        os.path.join(output_dir, 
22                                     vars['package'],
23                                     'template',
24                                     'conf'))
25
Note: See TracBrowser for help on using the repository browser.