Add more variations of project name when creating via scaffold
This commit is contained in:
parent
68fea2f59a
commit
e61b60e412
|
@ -27,6 +27,7 @@ Pyramid scaffold templates
|
||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
from rattail.files import resource_path
|
from rattail.files import resource_path
|
||||||
|
from rattail.util import prettify
|
||||||
|
|
||||||
from pyramid.scaffolds import PyramidTemplate
|
from pyramid.scaffolds import PyramidTemplate
|
||||||
|
|
||||||
|
@ -34,3 +35,11 @@ from pyramid.scaffolds import PyramidTemplate
|
||||||
class RattailTemplate(PyramidTemplate):
|
class RattailTemplate(PyramidTemplate):
|
||||||
_template_dir = resource_path('rattail:data/project')
|
_template_dir = resource_path('rattail:data/project')
|
||||||
summary = "Starter project based on Rattail / Tailbone"
|
summary = "Starter project based on Rattail / Tailbone"
|
||||||
|
|
||||||
|
def pre(self, command, output_dir, vars):
|
||||||
|
"""
|
||||||
|
Adds some more variables to the template context.
|
||||||
|
"""
|
||||||
|
vars['project_title'] = prettify(vars['project'])
|
||||||
|
vars['package_title'] = vars['package'].capitalize()
|
||||||
|
return super(RattailTemplate, self).pre(command, output_dir, vars)
|
||||||
|
|
Loading…
Reference in a new issue