(self, command, output_dir, vars)
Called before template is applied.
Called before template is applied.
Called before template is applied .
def pre(self, command, output_dir, vars):
        """Called before template is applied."""
        package_logger = vars['package']
        if package_logger == 'root':
            # Rename the app logger in the rare case a project is named 'root'
            package_logger = 'app'
        vars['package_logger'] = package_logger
        vars['template_engine'] = 'mako'

        template_engine = 'mako'

        if template_engine == 'mako':
            # Support a Babel extractor default for Mako
            vars['babel_templates_extractor'] = \
                ("('templates/**.mako', 'mako', {'input_encoding': 'utf-8'})"
                 ",\n%s#%s" % (' ' * 4, ' ' * 8))
        else:
            vars['babel_templates_extractor'] = ''

        # Ensure these exist in the namespace
        for name in self.ensure_names:
            vars.setdefault(name, '')

        vars['version'] = vars.get('version', '0.1')
        vars['zip_safe'] = asbool(vars.get('zip_safe', 'false'))
        vars['sqlalchemy'] = asbool(vars.get('sqlalchemy', 'false'))
def pre ( self , command , output_dir , vars ) : package_logger = vars [ 'package' ] if package_logger == 'root' : # Rename the app logger in the rare case a project is named 'root' package_logger = 'app' vars [ 'package_logger' ] = package_logger vars [ 'template_engine' ] = 'mako' template_engine = 'mako' if template_engine == 'mako' : # Support a Babel extractor default for Mako vars [ 'babel_templates_extractor' ] = ( "('templates/**.mako', 'mako', {'input_encoding': 'utf-8'})" ",\n%s#%s" % ( ' ' * 4 , ' ' * 8 ) ) else : vars [ 'babel_templates_extractor' ] = '' # Ensure these exist in the namespace for name in self . ensure_names : vars . setdefault ( name , '' ) vars [ 'version' ] = vars . get ( 'version' , '0.1' ) vars [ 'zip_safe' ] = asbool ( vars . get ( 'zip_safe' , 'false' ) ) vars [ 'sqlalchemy' ] = asbool ( vars . get ( 'sqlalchemy' , 'false' ) )