Eddie Hillenbrand avatar Eddie Hillenbrand committed 3d831be

Use Jinja2 for templates by default.

Comments (0)

Files changed (2)

ignite/ignite-templates/basic_package/setup.py_tmpl

 from setuptools import setup, find_packages
 import sys, os
 
-version = {{repr(version or "0.0")}}
+version = '{{version}}'
 
-setup(name={{repr(project)}},
+setup(name='{{project}}',
       version=version,
-      description="{{description or ''}}",
+      description='{{description}}',
       long_description="""\
-{{long_description or ''}}""",
-      classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
-      keywords={{repr(keywords or '')}},
-      author={{repr(author or '')}},
-      author_email={{repr(author_email or '')}},
-      url={{repr(url or '')}},
-      license={{repr(license_name or '')}},
+{{long_description}}""",
+      classifiers=[],
+      keywords='{{keywords}}',
+      author='{{author}}',
+      author_email='{{author_email}}',
+      url='{{url}}',
+      license='{{license_name}}',
       packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
       include_package_data=True,
-      zip_safe={{repr(bool(zip_safe or False))}},
+      zip_safe={{zip_safe}},
       install_requires=[
           # -*- Extra requirements: -*-
       ],

ignite/templates.py

 import inspect
 import copydir
 import command
+import jinja2
 
-from paste.util.template import paste_script_template_renderer
+def default_template_renderer(content, vars, filename=None):
+    template = jinja2.Template(content)
+    return template.render(vars)
 
 class Template(object):
 
         var('zip_safe', 'True/False: if the package can be distributed as a .zip file', default=False),
         ]
 
-    template_renderer = staticmethod(ignite_script_template_renderer)
+    template_renderer = staticmethod(default_template_renderer)
 
 _skip_variables = ['VFN', 'currentTime', 'self', 'VFFSL', 'dummyTrans',
                    'getmtime', 'trans']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.