Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(6)  |  Derive(0)  |  Import(8)
A template failed to be rendered.

src/p/i/piecutter-0.1.1/piecutter/engines/jinja.py   piecutter(Download)
 
from piecutter.engines import Engine
from piecutter.exceptions import TemplateError
 
 
            template = self.environment.from_string(template)
        except TemplateSyntaxError as e:
            raise TemplateError(e)
        try:
            return template.render(**context)
        except (UndefinedError, TypeError) as e:
            raise TemplateError(e)

src/p/i/piecutter-0.1.1/piecutter/engines/django.py   piecutter(Download)
 
from piecutter.engines import Engine
from piecutter.exceptions import TemplateError
 
settings.configure()
            return Template(template).render(Context(context))
        except TemplateSyntaxError as e:
            raise TemplateError(e)
 

src/p/i/piecutter-0.1.1/piecutter/resources.py   piecutter(Download)
from os.path import basename, isdir, isfile, join, normpath, relpath, sep
 
from piecutter.exceptions import TemplateError
 
 
            return [self.engine.render(self.read(), context).encode('utf-8')]
        except (TemplateError, UnicodeDecodeError) as e:
            raise TemplateError('%s: %s' % (self.path, e))
 
 

src/d/i/diecutter-0.6/diecutter/writers.py   diecutter(Download)
from cStringIO import StringIO
 
from piecutter.exceptions import TemplateError
 
 

src/d/i/diecutter-HEAD/diecutter/writers.py   diecutter(Download)
from cStringIO import StringIO
 
from piecutter.exceptions import TemplateError
 
 

src/p/i/piecutter-0.1.1/piecutter/tests/resources.py   piecutter(Download)
from piecutter import resources
from piecutter.engines.mock import MockEngine
from piecutter.exceptions import TemplateError
from piecutter.utils import temporary_directory
 
            template = u'Tea or coffee'
            context = {'a': 1, 'b': 2}
            engine = MockEngine(fail=TemplateError('This is an error message'))
            open(path, 'w').write(template.encode('utf8'))
            resource = resources.FileResource(path=path, engine=engine)
            expected_filename = 'rendered-filename/{args[0]!s}'
            filename_engine = MockEngine(expected_filename)
            content_engine = MockEngine(fail=TemplateError('error!'))
            context = {'fake': 'fake-context'}
            dir_path = join(template_dir, 'dir')

src/p/i/piecutter-0.1.1/piecutter/tests/engines/jinja.py   piecutter(Download)
 
from piecutter.engines.jinja import Jinja2Engine
from piecutter.exceptions import TemplateError
 
 

src/p/i/piecutter-0.1.1/piecutter/tests/engines/django.py   piecutter(Download)
 
from piecutter.engines.django import DjangoEngine
from piecutter.exceptions import TemplateError