Add more variations of project name when creating via scaffold

This commit is contained in:
Lance Edgar 2017-03-17 15:51:52 -05:00
parent 68fea2f59a
commit e61b60e412

View file

@ -27,6 +27,7 @@ Pyramid scaffold templates
from __future__ import unicode_literals, absolute_import
from rattail.files import resource_path
from rattail.util import prettify
from pyramid.scaffolds import PyramidTemplate
@ -34,3 +35,11 @@ from pyramid.scaffolds import PyramidTemplate
class RattailTemplate(PyramidTemplate):
_template_dir = resource_path('rattail:data/project')
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)