Skip to content
Newer
Older
100644 79 lines (68 sloc) 3.33 KB
3ef5e1d Initial import: No install test yet -- use at your own risk
mramm authored Apr 24, 2008
1 """Definitions for TurboGears quickstart templates"""
2 from paste.script import templates
7bbdaab move quickstart template to temptia
fredlin authored Apr 24, 2008
3 from tempita import paste_script_template_renderer
3ef5e1d Initial import: No install test yet -- use at your own risk
mramm authored Apr 24, 2008
4
5 class TurboGearsTemplate(templates.Template):
6 """
7 TurboGears 2 default paste template class
8 """
9 _template_dir = 'templates/turbogears'
7bbdaab move quickstart template to temptia
fredlin authored Apr 24, 2008
10 template_renderer = staticmethod(paste_script_template_renderer)
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
11 summary = 'TurboGears 2. Standard Quickstart Template'
12 egg_plugins = ['PasteScript', 'Pylons', 'TurboGears2']
97a5840 define additional template vars in pastetemplate.py to support paster…
sanjiv authored Feb 8, 2009
13 vars = [
14 templates.var('sqlalchemy', 'use SQLAlchemy as ORM', default=True),
1c62ad6 @amol- Ming MongoDB backend and authentication support
amol- authored Aug 10, 2011
15 templates.var('ming', 'use Ming as ORM', default=False),
97a5840 define additional template vars in pastetemplate.py to support paster…
sanjiv authored Feb 8, 2009
16 templates.var('auth', 'use authentication and authorization support', default="sqlalchemy"),
17 templates.var('geo', 'Include GIS support (True/False)', default='False'),
a42d3f1 @amol- Default on tw2, implement --enable-tw1 option to use tw1 so that crud…
amol- authored Mar 11, 2012
18 templates.var('tw1', 'Uses ToscaWidgets1 instead of ToscaWidgets2 (True/False)', default='False'),
0ee9e6f @lmacken Get our test suite running again...
lmacken authored Feb 22, 2010
19 templates.var('mako', 'Include Mako support (True/False)', default='False'),
c54899a @amol- Expose migrations command and initialize database version control whe…
amol- authored May 8, 2011
20 templates.var('migrations', 'Enable model migrations for SQLAlchemy (True/False)', default='True'),
97a5840 define additional template vars in pastetemplate.py to support paster…
sanjiv authored Feb 8, 2009
21 ]
3ef5e1d Initial import: No install test yet -- use at your own risk
mramm authored Apr 24, 2008
22
23 def pre(self, command, output_dir, vars):
24 """Called before template is applied."""
25 package_logger = vars['package']
26 if package_logger == 'root':
27 # Rename the app logger in the rare case a project is named 'root'
28 package_logger = 'app'
29 vars['package_logger'] = package_logger
30
7bbdaab move quickstart template to temptia
fredlin authored Apr 24, 2008
31 template_engine = \
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
32 vars.setdefault('template_engine',
33 'genshi')
3ef5e1d Initial import: No install test yet -- use at your own risk
mramm authored Apr 24, 2008
34
7bbdaab move quickstart template to temptia
fredlin authored Apr 24, 2008
35 if template_engine == 'mako':
36 # Support a Babel extractor default for Mako
37 vars['babel_templates_extractor'] = \
38 "('templates/**.mako', 'mako', None),\n%s#%s" % (' ' * 4,
39 ' ' * 8)
40 else:
41 vars['babel_templates_extractor'] = ''
6f440ef add support for tgext.geo. fixes #1863
sanjiv authored Jan 30, 2009
42
43 if vars['geo'] == 'True':
44 # Add tgext.geo as paster plugin
45 vars['egg_plugins'].append('tgext.geo')
46
c54899a @amol- Expose migrations command and initialize database version control whe…
amol- authored May 8, 2011
47 if vars['migrations'] == 'True':
48 vars['egg_plugins'].append('tg.devtools')
49
f6662cb @pedersen Adding tgext template, copied directly from alexandru_marinescu. See h…
pedersen authored Dec 16, 2009
50 class TurboGearsExtTemplate(templates.Template):
51 """
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
52 TurboGears 2 extension paster template class
f6662cb @pedersen Adding tgext template, copied directly from alexandru_marinescu. See h…
pedersen authored Dec 17, 2009
53 """
54
55 summary = 'TurboGears 2 extension template'
56
57 _template_dir = 'templates/tgext'
58 template_renderer = staticmethod(paste_script_template_renderer)
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
59 egg_plugins = ['TurboGears2', 'Pylons', 'PasteScript']
f6662cb @pedersen Adding tgext template, copied directly from alexandru_marinescu. See h…
pedersen authored Dec 17, 2009
60 required_templates = []
61 vars = [
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
62 templates.var('description', 'Short description of the extension')
f6662cb @pedersen Adding tgext template, copied directly from alexandru_marinescu. See h…
pedersen authored Dec 17, 2009
63 ]
64
65 def pre(self, command, output_dir, vars):
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
66 # FIXME: for the moment we have to do a copy/paste from the Turbogears
67 # template so that we have defined the variables from setup.py_tmpl
68 # which is very similar to the one found in the Turbogears quickstart
69 # template.
f6662cb @pedersen Adding tgext template, copied directly from alexandru_marinescu. See h…
pedersen authored Dec 17, 2009
70 template_engine = vars.setdefault('template_engine', 'genshi')
71 vars['sqlalchemy'] = True
72 if template_engine == 'mako':
73 # Support a Babel extractor default for Mako
74 vars['babel_templates_extractor'] = \
75 "('templates/**.mako', 'mako', None),\n%s#%s" % (' ' * 4,
76 ' ' * 8)
77 else:
a856c35 copied tg template over for mongo.
percious authored Nov 14, 2010
78 vars['babel_templates_extractor'] = ''
Something went wrong with that request. Please try again.