def render(self, context): try: path = self.sass_processor(self.sass_processor.resolve_path(context)) except AttributeError as e: msg = "No sass/scss file specified while rendering tag 'sass_src' in template {} ({})" raise TemplateSyntaxError(msg.format(context.template_name, e)) except FileNotFoundError as e: msg = str(e) + " while rendering tag 'sass_src' in template {}" raise TemplateSyntaxError(msg.format(context.template_name)) return SassProcessor.handle_simple(path)
def _sass_src_support(self, path, source_file): sass_processor = SassProcessor(source_file) return SassProcessor.handle_simple(sass_processor(path))