<s> from coffin . template import Library <EOL> from django . template . loader import render_to_string <EOL> from jinja2 import nodes <EOL> from jinja2 . ext import Extension <EOL> register = Library ( ) <EOL> class MerchantExtension ( Extension ) : <EOL> tags = set ( [ '<STR_LIT>' ] ) <EOL> def parse ( self , parser ) : <EOL> stream = parser . stream <EOL> lineno = stream . next ( ) . lineno <EOL> obj = parser . parse_expression ( ) <EOL> call_node = self . call_method ( '<STR_LIT>' , args = [ obj ] ) <EOL> return nodes . Output ( [ call_node ] ) . set_lineno ( lineno ) <EOL> @ classmethod <EOL> def render_integration ( self , obj ) : <EOL> form_str = render_to_string ( obj . template , { '<STR_LIT>' : obj } ) <EOL> return form_str <EOL> register . tag ( MerchantExtension ) </s>
